snuyanzin commented on code in PR #28277:
URL: https://github.com/apache/flink/pull/28277#discussion_r3324059478


##########
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/operations/SqlNodeConvertContext.java:
##########
@@ -110,6 +127,55 @@ public String toQuotedSqlString(SqlNode sqlNode) {
         return sqlNode.toSqlString(getSqlDialect()).getSql();
     }
 
+    @Override
+    public Optional<String> toRawSqlString(SqlNode node) {

Review Comment:
   is the implementation consistent?
   what happen if 
   ```java
         final String outerStatement = "CREATE TABLE x AS SELECT a FROM t1";
         final FlinkPlannerImpl planner = 
getPlannerBySqlDialect(SqlDialect.DEFAULT);
         final CalciteParser parser = getParserBySqlDialect(SqlDialect.DEFAULT);
         final SqlNode innerAsQuery =
                 ((SqlCreateTableAs) parser.parse(outerStatement)).getAsQuery();
   
   new SqlNodeConvertContext(planner, catalogManager, outerStatement)
                         .toRawSqlString(innerAsQuery));
   
   // AND
   new SqlNodeConvertContext(planner, catalogManager, "SELECT a FROM t1")
                         .toRawSqlString(innerAsQuery));
   ```
   will they have same result?



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