You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@bahir.apache.org by GitBox <gi...@apache.org> on 2019/08/13 10:45:53 UTC

[GitHub] [bahir-flink] eskabetxe commented on a change in pull request #63: Bug fix: When auto create table throw table already exists exception

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


With regards,
Apache Git Services