Airblader commented on a change in pull request #16142:
URL: https://github.com/apache/flink/pull/16142#discussion_r656938237



##########
File path: 
flink-connectors/flink-connector-kafka/src/main/java/org/apache/flink/streaming/connectors/kafka/table/DynamicKafkaSerializationSchema.java
##########
@@ -166,6 +167,15 @@ public void setPartitions(int[] partitions) {
 
     @Override
     public String getTargetTopic(RowData element) {
+        // no explicit topic defined in table options, use the writable 
metadata column topic
+        topic =

Review comment:
       When `getTargetTopic(firstElement)` is called and `topic == null`, this 
will assign the value from the metadata to the topic. Now if 
`getTargetTopic(secondElement)` is called, `topic` will no longer be `null` and 
thus the metadata will not be read from the second element, so no matter what 
the metadata of this second element is, `topic` will be that of the first 
element still. Is that correct?




-- 
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:
[email protected]


Reply via email to