eskabetxe commented on a change in pull request #63: Bug fix: When auto create 
table throw table already exists exception
URL: https://github.com/apache/bahir-flink/pull/63#discussion_r313330995
 
 

 ##########
 File path: 
flink-connector-kudu/src/main/java/org/apache/flink/streaming/connectors/kudu/connector/KuduConnector.java
 ##########
 @@ -76,7 +76,14 @@ private KuduTable table(KuduTableInfo infoTable) throws 
IOException {
             return syncClient.openTable(tableName);
         }
         if (infoTable.createIfNotExist()) {
-            return syncClient.createTable(tableName, infoTable.getSchema(), 
infoTable.getCreateTableOptions());
+            try {
+                return syncClient.createTable(tableName, 
infoTable.getSchema(), infoTable.getCreateTableOptions());
+            }catch (KuduException ke){
+                if (ke.getMessage().contains("already exists with id ")) {
 
 Review comment:
   rely on exception message it's not the best approach

----------------------------------------------------------------
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]


With regards,
Apache Git Services

Reply via email to