Skip to content

chore(QTDI-3819): Upgrade Apache Beam to 2.61.0 - #1340

Open
undx wants to merge 7 commits into
masterfrom
undx/QTDI-3819_upgrade_beam_2_61
Open

undx wants to merge 7 commits into
masterfrom
undx/QTDI-3819_upgrade_beam_2_61

Conversation

@undx

@undx undx commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Requirements

  • Any code change adding any logic MUST be tested through a unit test executed with the default build
  • Any API addition MUST be done with a documentation update if relevant

Why this PR is needed?

QTDI-3819: component-runtime ships Beam 2.46.0 while data-processing-runtime uses 2.61.0, causing NoClassDefFoundError: org.apache.beam.sdk.util.construction.resources.PipelineResourcesDetector in FullRunJob (QTDI-3792). component-runtime is the reference for the Beam version.

What does this PR adds (design/code thoughts)?

  • beam.version 2.46.0 -> 2.61.0.
  • beam-sdks-java-extensions-avro added (managed in the root pom; added to beam, beam-junit, di, server image and server sample): AvroCoder moved there.
  • Removed the dropped @Experimental annotation; AvroRecord converts java.time.Instant values (now produced by the Beam Avro coder) to epoch millis/micros.
  • beam-junit Data.of snapshots its input: Beam 2.61 reads Create elements more than once and the join input is single-pass.
  • FlinkRunnerEnvironment uses beam-runners-flink-1.19 (1.14 does not exist in 2.61).
  • IndicesTest (approved change): the shaded avro package no longer exists in beam-sdks-java-core.
  • Potentially breaking for consumers pinned on Beam 2.46. Studio is not concerned.
  • Local: UT green on beam, beam-junit, di; related modules build. serialization-over-cluster IT fails the same on the 2.46 baseline (Maven resolver env issue).

AI generated code

https://internal.qlik.dev/general/ways-of-working/code-reviews/#guidelines-for-ai-generated-code

  • this PR has been written with the help of GitHub Copilot or another generative AI tool

Align component-runtime with the Beam version used by
data-processing-runtime (fixes the NoClassDefFoundError on
PipelineResourcesDetector seen in QTDI-3792).

- bump beam.version 2.46.0 -> 2.61.0
- add beam-sdks-java-extensions-avro (AvroCoder moved there)
- drop removed @experimental annotation
- convert java.time.Instant values in AvroRecord
- snapshot single-pass iterables in beam-junit Data.of
- use beam-runners-flink-1.19 in FlinkRunnerEnvironment

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Critical runtime dependency gaps and incorrect timestamp-micros handling remain, with missing coverage for the new conversion path.

4 open issues
What changed in this PR

Upgrades the repository’s Apache Beam baseline from 2.46.0 to 2.61.0 and adapts runtime, testing, Avro serialization, runner, and packaging integrations to Beam’s updated APIs and dependency layout.

Changes:

  • Updates Beam dependencies and adds the Avro extensions SDK where required.
  • Switches the Flink runner to 1.19 and snapshots single-pass Beam test inputs.
  • Migrates Avro coder imports, removes obsolete Beam annotations, and normalizes decoded timestamp values.
File Description
pom.xml Updates the managed Beam version to 2.61.0 and manages the Avro extensions dependency.
images/​component-server-image/​pom.xml Adds the Beam Avro extensions dependency to the server image.
component-studio/​component-runtime-di/​pom.xml Adds the Beam Avro extensions dependency for the DI module.
component-server-parent/​component-server/​pom.xml Packages the Beam Avro extensions dependency for the server sample.
component-runtime-testing/​component-runtime-junit/​src/​main/​java/​org/​talend/​sdk/​component/​junit/​environment/​builtin/​beam/​FlinkRunnerEnvironment.java Switches the Flink runner artifact to the Beam 1.19-compatible version.
component-runtime-testing/​component-runtime-beam-junit/​src/​main/​java/​org/​talend/​sdk/​component/​junit/​beam/​Data.java Snapshots iterable inputs before constructing Beam values.
component-runtime-testing/​component-runtime-beam-junit/​pom.xml Adds the Beam Avro extensions dependency for Beam JUnit support.
component-runtime-beam/​src/​test/​java/​org/​talend/​test/​wrapped/​JdbcSource.java Removes experimental annotations no longer available in Beam 2.61.
component-runtime-beam/​src/​test/​java/​org/​talend/​sdk/​component/​runtime/​beam/​transform/​avro/​SchemalessJsonToIndexedRecordTest.java Updates the AvroCoder import to the Beam extensions package.
component-runtime-beam/​src/​test/​java/​org/​talend/​sdk/​component/​runtime/​beam/​transform/​avro/​IndexedRecordToJsonTest.java Updates the AvroCoder import to the Beam extensions package.
component-runtime-beam/​src/​test/​java/​org/​talend/​sdk/​component/​runtime/​beam/​customizer/​IndicesTest.java Adjusts the Beam class-index assertion for the updated shaded contents.
component-runtime-beam/​src/​main/​java/​org/​talend/​sdk/​component/​runtime/​beam/​transform/​avro/​JsonToIndexedRecord.java Migrates the production AvroCoder import to the extensions package.
component-runtime-beam/​src/​main/​java/​org/​talend/​sdk/​component/​runtime/​beam/​TalendIO.java Removes a Beam experimental annotation dropped in the newer version.
component-runtime-beam/​src/​main/​java/​org/​talend/​sdk/​component/​runtime/​beam/​spi/​record/​AvroRecord.java Normalizes decoded Instant timestamp values to epoch-based representations.
component-runtime-beam/​src/​main/​java/​org/​talend/​sdk/​component/​runtime/​beam/​coder/​registry/​AvroCoderCache.java Migrates the cached AvroCoder import to the extensions package.
component-runtime-beam/​pom.xml Adds the Beam Avro extensions dependency to the Beam runtime module.

Review effort: Lite

Comment thread component-runtime-beam/pom.xml Resolved
…rated tests, cover Instant normalization

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The change leaves the Avro extension outside the Beam isolation index, so components declaring it may load a duplicate class copy and encounter class-identity conflicts.

1 open issue
4 resolved since last review

Review effort: Lite

Comment thread component-runtime-beam/pom.xml Resolved
…lation

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

A critical unresolved dependency-packaging issue can leave the production Direct runner without AvroCoder and cause a NoClassDefFoundError at runtime.

No open issues 🎉

1 previously missed issue

In code that hasn't changed since last review

High severity Add Beam Avro extension to generated runner dependency descriptors

component-runtime-beam/​pom.xml:75

The new provided dependency is not included in the Beam runner dependency descriptors generated by RunnerDependencies.groovy, which still resolves each descriptor from only beam-runners-direct-java or beam-runners-spark-3. The PR's own BeamEnvironment comment notes that the extension is not transitive for the non-Spark runner, so a production/runtime path using beam-runner_beam-runners-direct-java.dependencies can still load component-runtime-beam without AvroCoder and fail with NoClassDefFoundError. Add the extension as an explicit root to the runner dependency assembly (or otherwise include it in both generated descriptors).

1 resolved since last review

Review effort: Lite

…ors, fix sonar restricted identifier

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Human assessment is needed because timestamp normalization covers only root fields, leaving nested records or arrays potentially inconsistent for equality, hashing, or serialization.

No open issues 🎉

Review effort: Lite

undx and others added 3 commits November 23, 2026 16:13
Beam 2.61 registers java-time conversions by default for reflect datum
factories, turning date/time fields into LocalDate/LocalTime. Use a datum
factory without logical type conversions to keep Beam 2.46 behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@sonar-rnd

sonar-rnd Bot commented Nov 24, 2026

Copy link
Copy Markdown

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants