Skip to content

Commit f5871c5

Browse files
authored
Revert "Reuse shadowJar for spark client bundle jar maven publish (#1857)" (#1921)
…857)" This reverts commit 1f7f127. The shadowJar plugin actually stops publish the original jar, which is not what spark client intend to publish for the --package usage. Revert it for now, will follow up with a better way to reuse the shadow jar plugin, likely with a separate bundle project
1 parent 5745ae1 commit f5871c5

File tree

4 files changed

+12
-26
lines changed

4 files changed

+12
-26
lines changed

build-logic/src/main/kotlin/publishing/PublishingHelperPlugin.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,11 @@ constructor(private val softwareComponentFactory: SoftwareComponentFactory) : Pl
133133

134134
suppressPomMetadataWarningsFor("testFixturesApiElements")
135135
suppressPomMetadataWarningsFor("testFixturesRuntimeElements")
136+
137+
if (project.tasks.findByName("createPolarisSparkJar") != null) {
138+
// if the project contains spark client jar, also publish the jar to maven
139+
artifact(project.tasks.named("createPolarisSparkJar").get())
140+
}
136141
}
137142

138143
if (

plugins/spark/README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,15 @@ Right now, the plugin only provides support for Spark 3.5, Scala version 2.12 an
2929
and depends on iceberg-spark-runtime 1.9.0.
3030

3131
# Build Plugin Jar
32-
A shadowJar task is added to build a jar for the Polaris Spark plugin, the jar is named as:
32+
A task createPolarisSparkJar is added to build a jar for the Polaris Spark plugin, the jar is named as:
3333
`polaris-spark-<sparkVersion>_<scalaVersion>-<polarisVersion>-bundle.jar`. For example:
3434
`polaris-spark-3.5_2.12-0.11.0-beta-incubating-SNAPSHOT-bundle.jar`.
3535

36-
- `./gradlew :polaris-spark-3.5_2.12:shadowJar` -- build jar for Spark 3.5 with Scala version 2.12.
37-
- `./gradlew :polaris-spark-3.5_2.13:shadowJar` -- build jar for Spark 3.5 with Scala version 2.13.
36+
- `./gradlew :polaris-spark-3.5_2.12:createPolarisSparkJar` -- build jar for Spark 3.5 with Scala version 2.12.
37+
- `./gradlew :polaris-spark-3.5_2.13:createPolarisSparkJar` -- build jar for Spark 3.5 with Scala version 2.13.
3838

3939
The result jar is located at plugins/spark/v3.5/build/<scala_version>/libs after the build.
4040

41-
The shadowJar task is also executed automatically when you run `gradlew assemble` or `gradlew build`.
42-
4341
# Start Spark with Local Polaris Service using built Jar
4442
Once the jar is built, we can manually test it with Spark and a local Polaris service.
4543

plugins/spark/v3.5/spark/build.gradle.kts

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@
1919

2020
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
2121

22-
plugins {
23-
id("polaris-client")
24-
id("com.gradleup.shadow")
25-
}
22+
plugins { id("polaris-client") }
2623

2724
// get version information
2825
val sparkMajorVersion = "3.5"
@@ -115,7 +112,7 @@ dependencies {
115112
}
116113
}
117114

118-
tasks.named<ShadowJar>("shadowJar") {
115+
tasks.register<ShadowJar>("createPolarisSparkJar") {
119116
archiveClassifier = "bundle"
120117
isZip64 = true
121118

@@ -138,11 +135,8 @@ tasks.named<ShadowJar>("shadowJar") {
138135
exclude(dependency("org.apache.avro:avro*.*"))
139136
}
140137

141-
relocate("com.fasterxml", "org.apache.polaris.shaded.com.fasterxml")
138+
relocate("com.fasterxml", "org.apache.polaris.shaded.com.fasterxml.jackson")
142139
relocate("org.apache.avro", "org.apache.polaris.shaded.org.apache.avro")
143140
}
144141

145-
// ensure the shadowJar job is run for both `assemble` and `build` task
146-
tasks.named("assemble") { dependsOn("shadowJar") }
147-
148-
tasks.named("build") { dependsOn("shadowJar") }
142+
tasks.withType(Jar::class).named("sourcesJar") { dependsOn("createPolarisSparkJar") }

site/content/in-dev/unreleased/polaris-spark-client.md

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -128,14 +128,3 @@ The Polaris Spark client has the following functionality limitations:
128128
3) Rename a Delta table is not supported.
129129
4) ALTER TABLE ... SET LOCATION is not supported for DELTA table.
130130
5) For other non-Iceberg tables like csv, it is not supported.
131-
132-
## Iceberg Spark Client compatibility with Polaris Spark Client
133-
The Polaris Spark client today depends on a specific Iceberg client version, and the version dependency is described
134-
in the following table:
135-
136-
| Spark Client Version | Iceberg Spark Client Version |
137-
|----------------------|------------------------------|
138-
| 1.0.0 | 1.9.0 |
139-
140-
The Iceberg dependency is automatically downloaded when the Polaris package is downloaded, so there is no need to
141-
add the Iceberg Spark client in the `packages` configuration.

0 commit comments

Comments
 (0)