Skip to content

Commit

Permalink
build fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedabu98 committed Jan 7, 2025
1 parent 5572ca2 commit 4b7e711
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 23 deletions.
41 changes: 19 additions & 22 deletions sdks/java/io/iceberg/bqms/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,39 +17,28 @@
*/
plugins {
id 'org.apache.beam.module'
id 'com.github.johnrengelman.shadow'
}
def bqmsLocation = "$buildDir/libs"

applyJavaNature(
automaticModuleName: 'org.apache.beam.sdk.io.iceberg.bqms',
shadowClosure: {
dependencies {
include(dependency(files("$bqmsLocation/iceberg-bigquery-catalog-1.5.2-0.1.0.jar")))
}
relocate 'com.google.guava', getJavaRelocatedPath('iceberg.bqms.com.google.guava')
},
exportJavadoc: false,
publish: false, // it's an intermediate jar for io-expansion-service
)


dependencies {
implementation files("$bqmsLocation/iceberg-bigquery-catalog-1.5.2-0.1.0.jar")
}
task downloadBqmsJar(type: Copy) {
doLast {
def jarUrl = 'https://storage.googleapis.com/spark-lib/bigquery/iceberg-bigquery-catalog-1.5.2-0.1.0.jar'
def outputDir = file("$bqmsLocation")
outputDir.mkdirs()
def destFile = new File(outputDir, 'iceberg-bigquery-catalog-1.5.2-0.1.0.jar')
def jarUrl = 'https://storage.googleapis.com/spark-lib/bigquery/iceberg-bigquery-catalog-1.5.2-0.1.0.jar'
def outputDir = file("$bqmsLocation")
outputDir.mkdirs()
def destFile = new File(outputDir, 'iceberg-bigquery-catalog-1.5.2-0.1.0.jar')

if (!destFile.exists()) {
try {
ant.get(src: jarUrl, dest: destFile)
println "Successfully downloaded BQMS catalog jar: $destFile"
} catch (Exception e) {
println "Could not download $jarUrl: ${e.message}"
}
if (!destFile.exists()) {
try {
ant.get(src: jarUrl, dest: destFile)
println "Successfully downloaded BQMS catalog jar: $destFile"
} catch (Exception e) {
println "Could not download $jarUrl: ${e.message}"
}
}
}
Expand All @@ -62,5 +51,13 @@ repositories {

compileJava.dependsOn downloadBqmsJar

dependencies {
implementation files("$bqmsLocation/iceberg-bigquery-catalog-1.5.2-0.1.0.jar")
}

shadowJar {
relocate 'com.google.guava', getJavaRelocatedPath('iceberg.bqms.com.google.guava')
}

description = "Apache Beam :: SDKs :: Java :: IO :: Iceberg :: BigQuery Metastore"
ext.summary = "A copy of the BQMS catalog."
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ public Catalog createCatalog() {

@Override
public void catalogCleanup() throws Exception {
System.out.println("xxx CLEANING UP!");
if (hiveMetastoreExtension != null) {
hiveMetastoreExtension.cleanup();
}
Expand Down

0 comments on commit 4b7e711

Please sign in to comment.