MonsterChenzhuo commented on code in PR #1827:
URL: https://github.com/apache/incubator-paimon/pull/1827#discussion_r1301266248
##########
paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/action/cdc/kafka/KafkaSchema.java:
##########
@@ -117,16 +120,13 @@ public static KafkaSchema getKafkaSchema(Configuration
kafkaConfig, String topic
ConsumerRecords<String, String> records =
consumer.poll(Duration.ofMillis(POLL_TIMEOUT_MILLIS));
for (ConsumerRecord<String, String> record : records) {
- String format =
kafkaConfig.get(KafkaConnectorOptions.VALUE_FORMAT);
- if ("canal-json".equals(format)) {
- CanalRecordParser parser = new CanalRecordParser(true,
Collections.emptyList());
- KafkaSchema kafkaSchema =
parser.getKafkaSchema(record.value());
- if (kafkaSchema != null) {
- return kafkaSchema;
- }
- } else {
- throw new UnsupportedOperationException(
- "This format: " + format + " is not support.");
+ DataFormat format = getDataFormat(kafkaConfig);
+ RecordParser recordParser =
+ format.createParser(
+ true, new TableNameConverter(true),
Collections.emptyList());
Review Comment:
done.
--
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]