davidradl commented on code in PR #23455:
URL: https://github.com/apache/flink/pull/23455#discussion_r1337682156


##########
flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/api/internal/TableEnvironmentImpl.java:
##########
@@ -1050,10 +1052,15 @@ private TableResultInternal executeInternal(
     }
 
     private TableResultInternal executeQueryOperation(QueryOperation 
operation) {
+        String querySql = null;
+        if (operation instanceof QuerySqlOperation) {
+            querySql = ((QuerySqlOperation) operation).getQuerySql();
+        }
         CollectModifyOperation sinkOperation = new 
CollectModifyOperation(operation);
         List<Transformation<?>> transformations =
                 translate(Collections.singletonList(sinkOperation));
-        final String defaultJobName = "collect";
+        final String defaultJobName =
+                StringUtils.isNullOrWhitespaceOnly(querySql) ? "collect" : 
querySql;

Review Comment:
   We could have an enumeration that would hold the type of the operation ; 
this field would be defined at the top of the hierarchy. Then to check the type 
of the operation, it is a comparison on this type rather than having to use 
reflection.



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to