fsk119 commented on a change in pull request #12805:
URL: https://github.com/apache/flink/pull/12805#discussion_r450119872



##########
File path: 
flink-connectors/flink-connector-kafka-0.11/src/main/java/org/apache/flink/streaming/connectors/kafka/table/Kafka011DynamicSink.java
##########
@@ -42,26 +44,31 @@ public Kafka011DynamicSink(
                        String topic,
                        Properties properties,
                        Optional<FlinkKafkaPartitioner<RowData>> partitioner,
-                       EncodingFormat<SerializationSchema<RowData>> 
encodingFormat) {
+                       EncodingFormat<SerializationSchema<RowData>> 
encodingFormat,
+                       String semantic) {
                super(
                                consumedDataType,
                                topic,
                                properties,
                                partitioner,
-                               encodingFormat);
+                               encodingFormat,
+                               semantic);
        }
 
        @Override
        protected SinkFunction<RowData> createKafkaProducer(
                        String topic,
                        Properties properties,
                        SerializationSchema<RowData> serializationSchema,
-                       Optional<FlinkKafkaPartitioner<RowData>> partitioner) {
+                       Optional<FlinkKafkaPartitioner<RowData>> partitioner,
+                       String semantic) {
                return new FlinkKafkaProducer011<>(
                                topic,
-                               serializationSchema,
+                               new 
KeyedSerializationSchemaWrapper<>(serializationSchema),
                                properties,
-                               partitioner);
+                               partitioner,
+                               getSemantic(semantic),

Review comment:
       I have already moved getSemantic logic from KafkaDynamicSink. However, I 
just add  a method named `transformSemantic` to resolve the gap between 
KafaProducer.Semantic and value of 'sink.semantic'. This method will 
   transform input of 'sink.semantic' and replace '-' with '_';




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to