Skip to content

fix the version string checks in KafkaIO #35703

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

Merged
merged 2 commits into from
Jul 27, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
import org.apache.beam.sdk.values.TypeDescriptor;
import org.apache.beam.vendor.guava.v32_1_2_jre.com.google.common.annotations.VisibleForTesting;
import org.apache.beam.vendor.guava.v32_1_2_jre.com.google.common.base.Joiner;
import org.apache.beam.vendor.guava.v32_1_2_jre.com.google.common.base.Strings;
import org.apache.beam.vendor.guava.v32_1_2_jre.com.google.common.collect.ImmutableList;
import org.apache.beam.vendor.guava.v32_1_2_jre.com.google.common.collect.ImmutableMap;
import org.apache.kafka.clients.CommonClientConfigs;
Expand Down Expand Up @@ -1858,7 +1859,7 @@ public PCollection<KafkaRecord<K, V>> expand(PBegin input) {
.getOptions()
.as(StreamingOptions.class)
.getUpdateCompatibilityVersion();
if (requestedVersionString != null
if (!Strings.isNullOrEmpty(requestedVersionString)
&& TransformUpgrader.compareVersions(requestedVersionString, "2.66.0") < 0) {
// Use discouraged Impulse for backwards compatibility with previous released versions.
output =
Expand Down Expand Up @@ -2830,7 +2831,7 @@ public PCollection<KafkaRecord<K, V>> expand(PCollection<KafkaSourceDescriptor>
.getOptions()
.as(StreamingOptions.class)
.getUpdateCompatibilityVersion();
if (requestedVersionString != null
if (!Strings.isNullOrEmpty(requestedVersionString)
&& TransformUpgrader.compareVersions(requestedVersionString, "2.60.0") < 0) {
// Redistribute is not allowed with commits prior to 2.59.0, since there is a Reshuffle
// prior to the redistribute. The reshuffle will occur before commits are offsetted and
Expand Down
Loading