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 2018/08/06 12:39:33 UTC

[GitHub] tragicjun commented on a change in pull request #6495: [FLINK-10061] [table] [kafka] Fix unsupported reconfiguration in KafkaTableSink

tragicjun commented on a change in pull request #6495: [FLINK-10061] [table] [kafka] Fix unsupported reconfiguration in KafkaTableSink
URL: https://github.com/apache/flink/pull/6495#discussion_r207876429
 
 

 ##########
 File path: flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/streaming/connectors/kafka/KafkaTableSink.java
 ##########
 @@ -166,8 +167,17 @@ public void emitDataStream(DataStream<Row> dataStream) {
 	@Override
 	public KafkaTableSink configure(String[] fieldNames, TypeInformation<?>[] fieldTypes) {
 		if (schema.isPresent()) {
-			// a fixed schema is defined so reconfiguration is not supported
-			throw new UnsupportedOperationException("Reconfiguration of this sink is not supported.");
+			if (getFieldTypes().length != fieldTypes.length || !Arrays.deepEquals(getFieldTypes(), fieldTypes)) {
+				String fixedFieldTypes = Arrays.deepToString(Arrays.stream(getFieldTypes())
+						.map(s -> s.getTypeClass().getSimpleName()).toArray());
 
 Review comment:
   The if statement uses `Arrays.deepEquals()` which is a clean way of comparing arrays. The `Arrays.deepToString()` is just used to build string representation of fieldTypes that are reflected in the exception message. Perhaps the code employs too many **Arrays**, please review it a bit closer :) 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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


With regards,
Apache Git Services