ahmedabu98 commented on code in PR #34334:
URL: https://github.com/apache/beam/pull/34334#discussion_r2001765985
##########
sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/meta/provider/kafka/KafkaTableProvider.java:
##########
@@ -129,13 +134,29 @@ public BeamSqlTable buildBeamSqlTable(Table table) {
* rows.
*/
if (payloadFormat.orElse("csv").equals("csv")) {
- return new BeamKafkaCSVTable(schema, bootstrapServers, topics);
+ kafkaTable = new BeamKafkaCSVTable(schema, bootstrapServers, topics);
+ } else {
+ PayloadSerializer serializer =
+ PayloadSerializers.getSerializer(
+ payloadFormat.get(), schema,
TableUtils.convertNode2Map(properties));
+ kafkaTable = new PayloadSerializerKafkaTable(schema, bootstrapServers,
topics, serializer);
+ }
+ }
+
+ // Get Consumer Properties from Table properties
+ HashMap<String, Object> configUpdates = new HashMap<String, Object>();
+ while (properties.fields().hasNext()) {
+ Entry<String, JsonNode> field = properties.fields().next();
+ if (field.getKey().startsWith("properties.")) {
+ configUpdates.put(field.getKey().replace("properties.", ""),
field.getValue().textValue());
}
- PayloadSerializer serializer =
- PayloadSerializers.getSerializer(
- payloadFormat.get(), schema,
TableUtils.convertNode2Map(properties));
- return new PayloadSerializerKafkaTable(schema, bootstrapServers, topics,
serializer);
}
+
+ if (!configUpdates.isEmpty()) {
+ kafkaTable.updateConsumerProperties(configUpdates);
Review Comment:
Interestingly this previously was an unused method
--
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]