klam-shop commented on code in PR #109: URL: https://github.com/apache/flink-connector-kafka/pull/109#discussion_r1700741770
########## flink-connector-kafka/src/main/java/org/apache/flink/streaming/connectors/kafka/table/KafkaDynamicSink.java: ########## @@ -393,6 +409,20 @@ private RowData.FieldGetter[] getFieldGetters( // -------------------------------------------------------------------------------------------- enum WritableMetadata { + TOPIC( + "topic", + DataTypes.STRING().nullable(), Review Comment: Good catch, we cannot set topic to null when it is writable ########## flink-connector-kafka/src/main/java/org/apache/flink/streaming/connectors/kafka/table/KafkaDynamicSink.java: ########## @@ -251,6 +258,12 @@ public DataStreamSink<?> consumeDataStream( public Map<String, DataType> listWritableMetadata() { final Map<String, DataType> metadataMap = new LinkedHashMap<>(); Stream.of(WritableMetadata.values()) + // When `topic` is a singleton list, TOPIC metadata is not writable + .filter( + m -> + topics == null + || topics.size() > 1 + || !WritableMetadata.TOPIC.key.equals(m.key)) Review Comment: Changed to for-loop -- 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: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org