danny0405 commented on a change in pull request #10523: 
[FLINK-15073][sql-client] SQL-CLI fails to run same query multiple times
URL: https://github.com/apache/flink/pull/10523#discussion_r356951860
 
 

 ##########
 File path: 
flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/gateway/local/LocalExecutor.java
 ##########
 @@ -638,6 +638,14 @@ public ProgramTargetDescriptor executeUpdate(String 
sessionId, String statement)
                        result.close();
                        // catch everything such that the query does not crash 
the executor
                        throw new SqlExecutionException("Invalid SQL query.", 
t);
+               } finally {
+                       // Remove the temporal table object.
+                       context.wrapClassLoader(() -> {
+                               final TableEnvironment tableEnvironment = 
context.getTableEnvironment();
+                               tableEnvironment
+                                               
.dropTemporaryTable(String.format("`%s`", jobName.replaceAll("`", "")));
 
 Review comment:
   Yes, you are right, for `dropTemporaryTable` we actually use the sql-parser 
to parse the identifier, so it should be valid or legal.

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


With regards,
Apache Git Services

Reply via email to