Skip to content

Commit 58bac32

Browse files
peterphitranclaude
andauthored
[IcebergIO] Raise Java 17 floor for IcebergIO's Java 11 dependents (#39064)
* [IcebergIO] Bump Java floor to 17 (prep for Iceberg 1.11.0) Iceberg 1.11.0 is published as Java 17 bytecode (class file version 61); Gradle module metadata declares "org.gradle.jvm.version": 17. The current Java 11 floor on sdks/java/io/iceberg causes Iceberg 1.11.0 artifacts to fail resolution. Raise the floor independently so the version bump is a clean diff. Iceberg 1.10.0 still resolves under Java 17 (10.0 only requires Java 11+). Tracks #38925. * [IcebergIO] Run IcebergIO CI workflows on Java 17 Iceberg 1.11.0 dropped Java 11 support and this branch raised the iceberg module floor to Java 17 (requireJavaVersion VERSION_17). The IO_Iceberg_* workflows call setup-environment-action without a java-version, which defaults to Java 11, so the module would fail to build or be disabled on CI. Pin these workflows to Java 17, matching the Delta and Debezium IO workflows. For #38925 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * [IcebergIO] Raise Java 17 floor for IcebergIO's Java 11 dependents Bumping the iceberg module to Java 17 (Iceberg 1.11.0 dropped Java 11) breaks the Java 11 modules that depend on it, because Gradle's JVM-version variant resolution refuses to let a Java 11 consumer depend on a Java 17 library. Raise requireJavaVersion 11 -> 17 in: - sdks/java/extensions/sql/iceberg - examples/java/iceberg The Java IO expansion service (sdks/java/io/expansion-service) also depends on IcebergIO but was already raised to Java 17 on master in For #38925 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * [IcebergIO] Fix Checker skipUses regex dropped on forked Java 17 compile Raising the Java 17 floor routes IcebergIO through a forked compile: on an older host JDK (e.g. Java 11 CI) the module is compiled by a separate Java 17 javac launched via java17Home, and Gradle passes its arguments through an @argfile. The backslash-escaped '\.' in Beam's Checker Framework -AskipUses and -AskipDefs regexes does not survive that @argfile round-trip, so '^org\.slf4j\.Logger.*' becomes a literal-backslash regex that matches nothing and the org.slf4j.Logger nullness suppression is silently dropped. Two latent Logger.info(@nullable) calls in IcebergIO then hard-error under the NullnessChecker. Use the backslash-free character class '[.]' (semantically identical to '\.') so the regexes survive the @argfile round-trip. This fixes the suppression for every module that forks to a newer JDK, with no behavior change on the in-process compile path. * [IcebergIO] Run xlang wrapper validation expansion service on Java 17 The cross-language wrapper validation launches the io expansion-service jar from Python via JAVA_HOME. That jar bundles IcebergIO, now Java 17 bytecode, so launching it on the default Java 11 fails with UnsupportedClassVersionError. createCrossLanguageUsingJavaExpansionTask was missing the JAVA_HOME redirect that #38974 added to the other cross-language task factories. Add it, driven by -PtestJavaVersion (resolving java\Home), and pass -PtestJavaVersion=17 in the Xlang_Generated_Transforms precommit so the expansion service runs on a JDK that can load the bundled Java 17 IOs. * Trigger Python Xlang IO postcommits * [IcebergIO] Run Python Xlang IO postcommits on Java 17 * [IcebergIO] Pin Java 17 on IO expansion service test suites * [IcebergIO] Address Java 17 review comments * [IcebergIO] Raise Iceberg integration tests to Java 17 --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent ec7004f commit 58bac32

11 files changed

Lines changed: 26 additions & 16 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"comment": "Modify this file in a trivial way to cause this test suite to run",
3-
"modification": 1
3+
"modification": 2
44
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"comment": "Modify this file in a trivial way to cause this test suite to run",
3-
"modification": 6
3+
"modification": 7
44
}

.github/workflows/beam_PerformanceTests_xlang_KafkaIO_Python.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ jobs:
7575
- name: Setup environment
7676
uses: ./.github/actions/setup-environment-action
7777
with:
78-
java-version: default
78+
java-version: '17'
7979
python-version: default
8080
- name: Set k8s access
8181
uses: ./.github/actions/setup-k8s-access

.github/workflows/beam_PostCommit_Python_Xlang_IO_Dataflow.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ jobs:
7575
- name: Setup environment
7676
uses: ./.github/actions/setup-environment-action
7777
with:
78-
java-version: default
78+
java-version: '17'
7979
python-version: |
8080
3.10
8181
3.14

.github/workflows/beam_PostCommit_Python_Xlang_IO_Direct.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ jobs:
7575
- name: Setup environment
7676
uses: ./.github/actions/setup-environment-action
7777
with:
78-
java-version: default
78+
java-version: '17'
7979
python-version: |
8080
3.10
8181
3.14

CHANGES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@
7979
* (Python) Removed `google-perftools` from the SDK container images. Users who wish to use `--profiler_agent=tcmalloc` should install google-perftools APT package in their custom container images separately ([#39323](https://github.com/apache/beam/issues/39323)).
8080
* `DoFn.process` returning a `str`, `bytes`, or `dict` (instead of an iterable wrapping one) now raises a `TypeError` rather than silently iterating per-character/byte/key (Python) ([#18712](https://github.com/apache/beam/issues/18712)).
8181
* (Java) Added `DRAINING` and `DRAINED` states to `PipelineResult`, including runner state mappings and Dataflow update handling ([#39020](https://github.com/apache/beam/issues/39020)).
82+
* (Python) Typehints of dataclass fields are honored during type inferences. To restore the behavior of fallback-to-any,
83+
use pipeline option `--exclude_infer_dataclass_field_type` ([#38797](https://github.com/apache/beam/issues/38797)).
84+
However fixing forward is recommended.
85+
* (Java) IcebergIO now requires Java 17 at runtime. This raises the floor in preparation for the Iceberg 1.11.0 upgrade ([#38925](https://github.com/apache/beam/issues/38925)).
8286

8387
## Deprecations
8488

buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1257,20 +1257,26 @@ class BeamModulePlugin implements Plugin<Project> {
12571257
maxHeapSize = '2g'
12581258
}
12591259

1260+
// NOTE: Use the character class "[.]" instead of an escaped "\\." to match a literal dot in
1261+
// these Checker Framework -AskipDefs/-AskipUses regexes. When a module is compiled on an older
1262+
// host JDK and forked to a newer JDK via javaXXHome (e.g. iceberg's requireJavaVersion 17 on a
1263+
// Java 11 CI host), Gradle passes the javac arguments through an @argfile. Backslash escapes do
1264+
// not survive that round-trip intact, so "\\." becomes a literal-backslash regex that matches
1265+
// nothing and the suppression is silently dropped. "[.]" is backslash-free and survives.
12601266
List<String> skipDefRegexes = []
12611267
skipDefRegexes << "AutoValue_.*"
12621268
skipDefRegexes << "AutoBuilder_.*"
12631269
skipDefRegexes << "AutoOneOf_.*"
1264-
skipDefRegexes << ".*\\.jmh_generated\\..*"
1270+
skipDefRegexes << ".*[.]jmh_generated[.].*"
12651271
skipDefRegexes += configuration.generatedClassPatterns
12661272
skipDefRegexes += configuration.classesTriggerCheckerBugs.keySet()
12671273
String skipDefCombinedRegex = skipDefRegexes.collect({ regex -> "(${regex})"}).join("|")
12681274

12691275
List<String> skipUsesRegexes = []
12701276
// zstd-jni is not annotated, handles Zstd(De)CompressCtx.loadDict(null) just fine
1271-
skipUsesRegexes << "^com\\.github\\.luben\\.zstd\\..*"
1277+
skipUsesRegexes << "^com[.]github[.]luben[.]zstd[.].*"
12721278
// SLF4J logger handles null log message parameters
1273-
skipUsesRegexes << "^org\\.slf4j\\.Logger.*"
1279+
skipUsesRegexes << "^org[.]slf4j[.]Logger.*"
12741280
String skipUsesCombinedRegex = skipUsesRegexes.collect({ regex -> "(${regex})"}).join("|")
12751281

12761282
project.apply plugin: 'org.checkerframework'

examples/java/iceberg/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ plugins {
2626
applyJavaNature(
2727
exportJavadoc: false,
2828
automaticModuleName: 'org.apache.beam.examples.iceberg',
29-
// iceberg requires Java11+
30-
requireJavaVersion: JavaVersion.VERSION_11
29+
// iceberg requires Java17+
30+
requireJavaVersion: JavaVersion.VERSION_17
3131
)
3232

3333
description = "Apache Beam :: Examples :: Java :: Iceberg"

it/iceberg/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ plugins { id 'org.apache.beam.module' }
2222
applyJavaNature(
2323
automaticModuleName: 'org.apache.beam.it.iceberg',
2424
exportJavadoc: false,
25-
// iceberg ended support for Java 8 in 1.7.0
26-
requireJavaVersion: JavaVersion.VERSION_11,
25+
// iceberg ended support for Java 11 in 1.11.0
26+
requireJavaVersion: JavaVersion.VERSION_17,
2727
)
2828

2929
description = "Apache Beam :: IT :: Iceberg"

sdks/java/extensions/sql/iceberg/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ plugins { id 'org.apache.beam.module' }
2222

2323
applyJavaNature(
2424
automaticModuleName: 'org.apache.beam.sdk.extensions.sql.meta.provider.hcatalog',
25-
// iceberg requires Java11+
26-
requireJavaVersion: JavaVersion.VERSION_11,
25+
// iceberg requires Java17+
26+
requireJavaVersion: JavaVersion.VERSION_17,
2727
)
2828

2929
dependencies {

0 commit comments

Comments
 (0)