Skip to content

Commit b85646b

Browse files
committed
Remove primaryKeyColumns options
1 parent 315ed95 commit b85646b

2 files changed

Lines changed: 4 additions & 18 deletions

File tree

sdks/java/io/debezium/src/main/java/org/apache/beam/io/debezium/DebeziumIO.java

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import java.io.Serializable;
2424
import java.util.HashMap;
2525
import java.util.Map;
26-
import java.util.stream.Collectors;
2726
import org.apache.beam.sdk.coders.Coder;
2827
import org.apache.beam.sdk.coders.MapCoder;
2928
import org.apache.beam.sdk.coders.StringUtf8Coder;
@@ -319,23 +318,14 @@ protected Schema getRecordSchema() {
319318
SourceRecord sampledRecord =
320319
fn.getOneRecord(getConnectorConfiguration().getConfigurationMap());
321320
fn.reset();
322-
Schema keySchema =
323-
sampledRecord.keySchema() != null
324-
? KafkaConnectUtils.beamSchemaFromKafkaConnectSchema(sampledRecord.keySchema())
325-
: Schema.builder().build();
326321
Schema valueSchema =
327322
KafkaConnectUtils.beamSchemaFromKafkaConnectSchema(sampledRecord.valueSchema());
328323

329324
return Schema.builder()
330325
.addFields(valueSchema.getFields())
331-
.setOptions(
332-
Schema.Options.builder()
333-
.setOption(
334-
"primaryKeyColumns",
335-
Schema.FieldType.array(Schema.FieldType.STRING),
336-
keySchema.getFields().stream()
337-
.map(Schema.Field::getName)
338-
.collect(Collectors.toList())))
326+
// TODO(https://github.com/apache/beam/issues/39557):
327+
// Restore 'primaryKeyColumns' once Python can decode ARRAY<STRING>
328+
// schema options across the Java/Python cross-language boundary.
339329
.build();
340330
}
341331

sdks/java/io/debezium/src/main/java/org/apache/beam/io/debezium/DebeziumReadSchemaTransformProvider.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,6 @@ protected DebeziumReadSchemaTransformProvider(
7474
this.testLimitMilliseconds = timeLimitMs;
7575
}
7676

77-
private static Schema withoutOptions(Schema schema) {
78-
return Schema.builder().addFields(schema.getFields()).build();
79-
}
80-
8177
private static Connectors parseConnector(String value) {
8278
try {
8379
return Connectors.valueOf(value);
@@ -162,7 +158,7 @@ public PCollectionRowTuple expand(PCollectionRowTuple input) {
162158
}
163159

164160
// TODO(pabloem): Database connection issues can be debugged here.
165-
Schema recordSchema = withoutOptions(readTransform.getRecordSchema());
161+
Schema recordSchema = readTransform.getRecordSchema();
166162
LOG.info(
167163
"Computed schema for table {} from {}: {}",
168164
configuration.getTable(),

0 commit comments

Comments
 (0)