KurtYoung 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_r356946838
##########
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(() -> {
+ // Quotes the table name because as a
SqlIdentifier, it is invalid.
+ context.getTableEnvironment()
+
.dropTemporaryTable(String.format("`%s`", jobName));
Review comment:
How about just use a `UUID` for table name? The quoting logic seems a bit
hack to me.
----------------------------------------------------------------
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