File tree Expand file tree Collapse file tree
sdks/java/io/debezium/src/main/java/org/apache/beam/io/debezium Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2323import java .io .Serializable ;
2424import java .util .HashMap ;
2525import java .util .Map ;
26- import java .util .stream .Collectors ;
2726import org .apache .beam .sdk .coders .Coder ;
2827import org .apache .beam .sdk .coders .MapCoder ;
2928import 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
Original file line number Diff line number Diff 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 (),
You can’t perform that action at this time.
0 commit comments