Skip to content

Commit 9ab41be

Browse files
manuzhangcodex
andcommitted
Spark: Initial support for 4.2.0
Add Spark 4.2 module support and include follow-up compatibility fixes for Spark 4.2 view command handling and test expectations. Generated-by: Codex Co-authored-by: Codex <codex@openai.com>
1 parent 04eee63 commit 9ab41be

82 files changed

Lines changed: 903 additions & 936 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/spark-ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ jobs:
8383
matrix:
8484
jvm: [17, 21]
8585
event_name: ['${{ github.event_name }}']
86-
spark: ['3.5', '4.0', '4.1']
86+
spark: ['3.5', '4.0', '4.1', '4.2']
8787
scala: ['2.12', '2.13']
8888
# Split iceberg-spark (core) from iceberg-spark-extensions/-runtime
8989
# so they run as concurrent jobs rather than serially in one job.
@@ -95,6 +95,8 @@ jobs:
9595
scala: '2.12'
9696
- spark: '4.1'
9797
scala: '2.12'
98+
- spark: '4.2'
99+
scala: '2.12'
98100
# Pull requests run the baseline JDK only.
99101
- event_name: pull_request
100102
jvm: 21

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ spark/v4.0/spark/benchmark/*
3737
spark/v4.0/spark-extensions/benchmark/*
3838
spark/v4.1/spark/benchmark/*
3939
spark/v4.1/spark-extensions/benchmark/*
40+
spark/v4.2/spark/benchmark/*
41+
spark/v4.2/spark-extensions/benchmark/*
4042
*/benchmark/*
4143

4244
__pycache__/

build.gradle

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,23 @@ if (file("${rootDir}/iceberg-build.properties").exists()) {
109109
}
110110

111111
def projectVersion = getProjectVersion()
112+
def spark42VersionRegex = libs.versions.spark42.get().replace(".", "\\.")
112113
final REVAPI_PROJECTS = ["iceberg-api", "iceberg-core", "iceberg-parquet", "iceberg-orc", "iceberg-common", "iceberg-data"]
113114

114115
allprojects {
115116
group = "org.apache.iceberg"
116117
version = projectVersion
117118
repositories {
119+
exclusiveContent {
120+
forRepository {
121+
maven {
122+
url "https://repository.apache.org/content/repositories/orgapachespark-1526/"
123+
}
124+
}
125+
filter {
126+
includeVersionByRegex "org.apache.spark", ".*", spark42VersionRegex
127+
}
128+
}
118129
mavenCentral()
119130
mavenLocal()
120131
}

dev/stage-binaries.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@
2020

2121
SCALA_VERSION=2.12
2222
FLINK_VERSIONS=1.20,2.0,2.1
23-
SPARK_VERSIONS=3.5,4.0,4.1
23+
SPARK_VERSIONS=3.5,4.0,4.1,4.2
2424
KAFKA_VERSIONS=3
2525

2626
./gradlew -Prelease -DscalaVersion=$SCALA_VERSION -DflinkVersions=$FLINK_VERSIONS -DsparkVersions=$SPARK_VERSIONS -DkafkaVersions=$KAFKA_VERSIONS publishApachePublicationToMavenRepository --no-parallel --no-configuration-cache
2727

2828
# Also publish Scala 2.13 Artifacts for versions that support it.
2929
# Flink does not yet support 2.13 (and is largely dropping a user-facing dependency on Scala). Hive doesn't need a Scala specification.
3030
./gradlew -Prelease -DscalaVersion=2.13 -DsparkVersions=3.5 :iceberg-spark:iceberg-spark-3.5_2.13:publishApachePublicationToMavenRepository :iceberg-spark:iceberg-spark-extensions-3.5_2.13:publishApachePublicationToMavenRepository :iceberg-spark:iceberg-spark-runtime-3.5_2.13:publishApachePublicationToMavenRepository --no-parallel --no-configuration-cache
31-
# Spark 4.0 only supports Scala 2.13. no need to specify scalaVersion
31+
# Spark 4.0+ only supports Scala 2.13. no need to specify scalaVersion
3232

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ jmhJsonOutputPath=build/reports/jmh/results.json
1818
jmhIncludeRegex=.*
1919
systemProp.defaultFlinkVersions=2.1
2020
systemProp.knownFlinkVersions=1.20,2.0,2.1
21-
systemProp.defaultSparkVersions=4.1
22-
systemProp.knownSparkVersions=3.5,4.0,4.1
21+
systemProp.defaultSparkVersions=4.2
22+
systemProp.knownSparkVersions=3.5,4.0,4.1,4.2
2323
systemProp.defaultKafkaVersions=3
2424
systemProp.knownKafkaVersions=3
2525
systemProp.defaultScalaVersion=2.12

gradle/libs.versions.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ snowflake-jdbc = "3.28.0"
9090
spark35 = "3.5.8"
9191
spark40 = "4.0.3"
9292
spark41 = "4.1.2"
93+
spark42 = "4.2.0"
9394
sqlite-jdbc = "3.53.2.0"
9495
testcontainers = "2.0.5"
9596
tez08 = { strictly = "0.8.4"} # see rich version usage explanation above

jmh.gradle

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ if (sparkVersions.contains("4.1")) {
5353
jmhProjects.add(project(":iceberg-spark:iceberg-spark-extensions-4.1_2.13"))
5454
}
5555

56+
if (sparkVersions.contains("4.2")) {
57+
jmhProjects.add(project(":iceberg-spark:iceberg-spark-4.2_2.13"))
58+
jmhProjects.add(project(":iceberg-spark:iceberg-spark-extensions-4.2_2.13"))
59+
}
60+
5661
configure(jmhProjects) {
5762
apply plugin: 'me.champeau.jmh'
5863
apply plugin: 'io.morethan.jmhreport'

settings.gradle

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,18 @@ if (sparkVersions.contains("4.1")) {
175175
project(":iceberg-spark:spark-runtime-4.1_2.13").name = "iceberg-spark-runtime-4.1_2.13"
176176
}
177177

178+
if (sparkVersions.contains("4.2")) {
179+
include ":iceberg-spark:spark-4.2_2.13"
180+
include ":iceberg-spark:spark-extensions-4.2_2.13"
181+
include ":iceberg-spark:spark-runtime-4.2_2.13"
182+
project(":iceberg-spark:spark-4.2_2.13").projectDir = file('spark/v4.2/spark')
183+
project(":iceberg-spark:spark-4.2_2.13").name = "iceberg-spark-4.2_2.13"
184+
project(":iceberg-spark:spark-extensions-4.2_2.13").projectDir = file('spark/v4.2/spark-extensions')
185+
project(":iceberg-spark:spark-extensions-4.2_2.13").name = "iceberg-spark-extensions-4.2_2.13"
186+
project(":iceberg-spark:spark-runtime-4.2_2.13").projectDir = file('spark/v4.2/spark-runtime')
187+
project(":iceberg-spark:spark-runtime-4.2_2.13").name = "iceberg-spark-runtime-4.2_2.13"
188+
}
189+
178190
if (kafkaVersions.contains("3")) {
179191
include 'kafka-connect'
180192
project(':kafka-connect').name = 'iceberg-kafka-connect'

spark/build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,7 @@ if (sparkVersions.contains("4.0")) {
3131
if (sparkVersions.contains("4.1")) {
3232
apply from: file("$projectDir/v4.1/build.gradle")
3333
}
34+
35+
if (sparkVersions.contains("4.2")) {
36+
apply from: file("$projectDir/v4.2/build.gradle")
37+
}

spark/v4.2/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* under the License.
1818
*/
1919

20-
String sparkMajorVersion = '4.1'
20+
String sparkMajorVersion = '4.2'
2121
String scalaVersion = '2.13'
2222

2323
def sparkProjects = [
@@ -65,7 +65,7 @@ project(":iceberg-spark:iceberg-spark-${sparkMajorVersion}_${scalaVersion}") {
6565

6666
compileOnly libs.errorprone.annotations
6767
compileOnly libs.avro.avro
68-
compileOnly("org.apache.spark:spark-hive_${scalaVersion}:${libs.versions.spark41.get()}") {
68+
compileOnly("org.apache.spark:spark-hive_${scalaVersion}:${libs.versions.spark42.get()}") {
6969
exclude group: 'org.apache.avro', module: 'avro'
7070
exclude group: 'org.apache.arrow'
7171
exclude group: 'org.apache.parquet'
@@ -150,7 +150,7 @@ project(":iceberg-spark:iceberg-spark-extensions-${sparkMajorVersion}_${scalaVer
150150
compileOnly project(':iceberg-core')
151151
compileOnly project(':iceberg-common')
152152
compileOnly project(":iceberg-spark:iceberg-spark-${sparkMajorVersion}_${scalaVersion}")
153-
compileOnly("org.apache.spark:spark-hive_${scalaVersion}:${libs.versions.spark41.get()}") {
153+
compileOnly("org.apache.spark:spark-hive_${scalaVersion}:${libs.versions.spark42.get()}") {
154154
exclude group: 'org.apache.avro', module: 'avro'
155155
exclude group: 'org.apache.arrow'
156156
exclude group: 'org.apache.parquet'
@@ -245,7 +245,7 @@ project(":iceberg-spark:iceberg-spark-runtime-${sparkMajorVersion}_${scalaVersio
245245
}
246246

247247
integrationImplementation "org.scala-lang.modules:scala-collection-compat_${scalaVersion}:${libs.versions.scala.collection.compat.get()}"
248-
integrationImplementation("org.apache.spark:spark-hive_${scalaVersion}:${libs.versions.spark41.get()}") {
248+
integrationImplementation("org.apache.spark:spark-hive_${scalaVersion}:${libs.versions.spark42.get()}") {
249249
exclude group: 'org.roaringbitmap'
250250
}
251251
integrationImplementation libs.junit.jupiter

0 commit comments

Comments
 (0)