You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2021/06/24 19:39:29 UTC

[GitHub] [flink] AHeise commented on a change in pull request #16142: [FLINK-22748][connector-kafka] Allow dynamic target topic selection in SQL Kafka sinks

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



##########
File path: flink-connectors/flink-connector-kafka/src/main/java/org/apache/flink/streaming/connectors/kafka/FlinkKafkaProducer.java
##########
@@ -216,7 +216,7 @@
     protected final Properties producerConfig;
 
     /** The name of the default topic this producer is writing data to. */
-    protected final String defaultTopicId;
+    @Nullable protected String defaultTopicId;

Review comment:
       I don't understand why we need to make default topic nullable. We could just set "unspecified" on table API if there is no other value. Potentially add some special character that kafka doesn't support to make sure writing fails.
   As is, we change quite a bit of API and semantics and introduce new bugs (there is no guard against `defaultTopicId = null` and `getTargetTopic = null`).
   Another idea would be to explicitly support default topic option with said default value.  




-- 
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:
users@infra.apache.org