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

liufangliang commented on FLINK-18466:
--------------------------------------

Hi [~jark] ,

I run the unit test methed named `testJdbcOutputFormat` and entered a 
non-existent table name ,if the target table doesn't exist in external 
database, The exception will be caught  by the following code in class 
`JdbcBatchingOutputFormat`.

 
{code:java}
private JdbcExec 
createAndOpenStatementExecutor(StatementExecutorFactory<JdbcExec> 
statementExecutorFactory) throws IOException {
   JdbcExec exec = statementExecutorFactory.apply(getRuntimeContext());
   try {
      exec.prepareStatements(connection);
   } catch (SQLException e) {
      throw new IOException("unable to open JDBC writer", e);
   }
   return exec;
}{code}
In other words ,if the target table doesn't exist in external database, The 
exception will be caught when Connecting to the target database and 
initialization the prepared statement.

Looking forward to your reply, thanks.

 

> JDBC should fail-fast if the target table doesn't exist
> -------------------------------------------------------
>
>                 Key: FLINK-18466
>                 URL: https://issues.apache.org/jira/browse/FLINK-18466
>             Project: Flink
>          Issue Type: Bug
>          Components: Connectors / JDBC, Table SQL / Ecosystem
>            Reporter: Jark Wu
>            Priority: Major
>             Fix For: 1.12.0, 1.11.1
>
>         Attachments: image-2020-07-06-19-52-13-070.png
>
>
> Currently, if the target table doesn't exist in external database, JDBC sink 
> will try {{max-tries}} times and then fail. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to