ahmedabu98 commented on code in PR #31362:
URL: https://github.com/apache/beam/pull/31362#discussion_r1628208748
##########
sdks/java/io/kafka/src/main/java/org/apache/beam/sdk/io/kafka/KafkaReadSchemaTransformProvider.java:
##########
@@ -232,6 +116,140 @@ public List<String> outputCollectionNames() {
return Arrays.asList("output", "errors");
}
+ static class KafkaReadSchemaTransform extends SchemaTransform {
+ private final KafkaReadSchemaTransformConfiguration configuration;
+
+ KafkaReadSchemaTransform(KafkaReadSchemaTransformConfiguration
configuration) {
+ this.configuration = configuration;
+ }
+
+ Row getConfigurationRow() {
+ try {
+ // To stay consistent with our SchemaTransform configuration naming
conventions,
+ // we sort lexicographically
+ return SchemaRegistry.createDefault()
+ .getToRowFunction(KafkaReadSchemaTransformConfiguration.class)
+ .apply(configuration)
+ .sorted()
+ .toSnakeCase();
+ } catch (NoSuchSchemaException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ @Override
+ public PCollectionRowTuple expand(PCollectionRowTuple input) {
+ configuration.validate();
Review Comment:
Yep this is just a copy-paste
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]