-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support building with Java 21 #10474
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,7 +45,16 @@ subprojects { | |
apply plugin: 'com.palantir.baseline-reproducibility' | ||
apply plugin: 'com.palantir.baseline-exact-dependencies' | ||
apply plugin: 'com.palantir.baseline-release-compatibility' | ||
apply plugin: 'com.diffplug.spotless' | ||
// We need to update Google Java Format to 1.17.0+ to run spotless on JDK 8, but that requires dropping support for JDK 8. | ||
if (JavaVersion.current() == JavaVersion.VERSION_21) { | ||
task spotlessApply { | ||
doLast { | ||
throw new GradleException("Spotless plugin is currently disabled when running on JDK 21 (until we drop JDK 8). To run spotlessApply please use a different JDK version.") | ||
} | ||
} | ||
} else { | ||
apply plugin: 'com.diffplug.spotless' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we can merge the PR without having spotless enabled unfortunately There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wish this was avoidable. I do not know of a way to run same formatting rules under Java 8 and Java 21 and that's we support today. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you bring this topic up on the Dev mailing list to see what others think about adding JDK21 support without being able to run spotless? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the comment is not accurate: we need to update Google Java Format to 1.17.0+ to run spotless on JDK21, but it breaks JDK8. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jbonofre we can't upgrade the GJF as long as we support JDK8 because upgrading the GJF version will produce different results depending on the underlying JDK it is executed with and so CI actions (and locally) will fail. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's my point: I would postpone the JDK21 update right now, and jump directly to JDK21 without supporting JDK8 anymore. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Dropping JDK8 support means dropping Hive support (which I'm totally fine with) but we need to properly communicate which Iceberg version will drop Hive support. My understanding was that we were planning to drop Hive support with Iceberg 2.0 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes exactly. It's what I proposed while ago in the Iceberg 2.0 discussion thread. So, I propose:
I can reply on the Iceberg 2.0 thread if you want or Piotr can start a new thread about JDK21 on Iceberg 2.0. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Sir. Maybe the iceberg-hive module should be maintained by the hive community in the hive project. Because hive 3.X will EOL sooner or later. Or just keep the catalog support. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @BsoBird newer versions of Hive are maintained by the Hive community but the Iceberg community still maintains an older version of Hive |
||
} | ||
|
||
pluginManager.withPlugin('com.palantir.baseline-checkstyle') { | ||
checkstyle { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,6 +59,10 @@ project(":iceberg-spark:iceberg-spark-${sparkMajorVersion}_${scalaVersion}") { | |
implementation project(':iceberg-parquet') | ||
implementation project(':iceberg-arrow') | ||
implementation("org.scala-lang.modules:scala-collection-compat_${scalaVersion}:${libs.versions.scala.collection.compat.get()}") | ||
if (scalaVersion == '2.12') { | ||
// scala-collection-compat_2.12 pulls scala 2.12.17 and we need 2.12.18 for JDK 21 support | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. does this also apply for Scala 2.13? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. apparently not, i think the Ci would detect that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do you remember what the exact error msg was here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i don't, i should have kept a note |
||
implementation 'org.scala-lang:scala-library:2.12.18' | ||
} | ||
|
||
compileOnly libs.errorprone.annotations | ||
compileOnly libs.avro.avro | ||
|
@@ -136,6 +140,10 @@ project(":iceberg-spark:iceberg-spark-extensions-${sparkMajorVersion}_${scalaVer | |
|
||
dependencies { | ||
implementation "org.scala-lang.modules:scala-collection-compat_${scalaVersion}:${libs.versions.scala.collection.compat.get()}" | ||
if (scalaVersion == '2.12') { | ||
// scala-collection-compat_2.12 pulls scala 2.12.17 and we need 2.12.18 for JDK 21 support | ||
implementation 'org.scala-lang:scala-library:2.12.18' | ||
} | ||
implementation libs.roaringbitmap | ||
|
||
compileOnly "org.scala-lang:scala-library" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for adding that msg, that's going to be helpful