[ 
https://issues.apache.org/jira/browse/FLINK-10061?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16570215#comment-16570215
 ] 

ASF GitHub Bot commented on FLINK-10061:
----------------------------------------

twalthr 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_r207896054
 
 

 ##########
 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:
   Sorry, seems I did a too quick look at the code. The code just looked 
unnecessary complicated to me. A simple `Arrays.toString()` should also do the 
job. Btw the checking of the field names is missing nevertheless. 

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


> Fix unsupported reconfiguration in KafkaTableSink
> -------------------------------------------------
>
>                 Key: FLINK-10061
>                 URL: https://issues.apache.org/jira/browse/FLINK-10061
>             Project: Flink
>          Issue Type: Bug
>          Components: Kafka Connector
>    Affects Versions: 1.6.0
>            Reporter: Jun Zhang
>            Assignee: Jun Zhang
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.6.1, 1.7.0
>
>
> When using KafkaTableSink in "table.writeToSink(), the following exception is 
> thrown:
> {quote} java.lang.UnsupportedOperationException: Reconfiguration of this sink 
> is not supported.
> {quote}
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to