leonardBang commented on a change in pull request #11223: [FLINK-16281][Table 
SQL / Ecosystem] parameter 'maxRetryTimes' can not work in JDBCUpsertTableSink.
URL: https://github.com/apache/flink/pull/11223#discussion_r385180092
 
 

 ##########
 File path: 
flink-connectors/flink-jdbc/src/test/java/org/apache/flink/api/java/io/jdbc/JDBCUpsertTableSinkITCase.java
 ##########
 @@ -211,4 +213,31 @@ public void testAppend() throws Exception {
                                Row.of(20, 6, Timestamp.valueOf("1970-01-01 
00:00:00.02"))
                }, DB_URL, OUTPUT_TABLE2, new String[]{"id", "num", "ts"});
        }
+
+       @Test(expected = JobExecutionException.class)
+       public void testTableNotExists() throws Exception {
 
 Review comment:
   As this issue describe,this test will hang rather than throw an Exception 
when the parameter connector.write.max-retries > 1, so I add this case to check 
that exception will throw properly after retry 3 times.  
   
   I found this test passed in master,because this  'table not exists 
Exception' was thrown in open() function not in flush().  
   `@Override
        public void open(Connection connection) throws SQLException {
                this.cachedRows = new ArrayList<>();
                this.statement = connection.prepareStatement(insertSQL);
        }
   `
   when I used 'com.mysql.jdbc.Driver' it will be thrown in in flush() rather 
than open() function, the difference should be that we use 
'org.apache.derby.jdbc.EmbeddedDriver' in ITcase.
   
   So, I will drop this function and try other tests to cover this issue update.

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