englefly commented on code in PR #18062:
URL: https://github.com/apache/doris/pull/18062#discussion_r1151838376


##########
fe/fe-core/src/main/antlr4/org/apache/doris/nereids/DorisParser.g4:
##########
@@ -56,15 +56,17 @@ planType
     ;
 
 //  -----------------Query-----------------
+// add queryOrganization for parse (q1) union (q2) union (q3) order by keys, 
otherwise 'order' will be recognized to be
+// identifier.
 query
     : {!doris_legacy_SQL_syntax}? cte? queryTerm queryOrganization
-    | {doris_legacy_SQL_syntax}? queryTerm
+    | {doris_legacy_SQL_syntax}? queryTerm queryOrganization
     ;
 
 queryTerm
     : queryPrimary                                                             
          #queryTermDefault
     | left=queryTerm operator=(UNION | EXCEPT | INTERSECT)
-      setQuantifier? right=queryTerm                                           
          #setOperation
+      setQuantifier? right=queryTerm                                           
         #setOperation

Review Comment:
   it seems that in the edit version the comments are not aligned



##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalSetOperation.java:
##########
@@ -114,12 +114,13 @@ public List<NamedExpression> 
buildNewOutputs(List<Expression> leftCastExpression
         ImmutableList.Builder<NamedExpression> newOutputs = new Builder<>();
         for (Expression expression : leftCastExpressions) {
             if (expression instanceof Cast) {
+                Cast cast = ((Cast) expression);
                 newOutputs.add(new SlotReference(
-                        ((Cast) expression).child().toSql(), 
expression.getDataType(),
-                        ((Cast) expression).child().nullable()));
+                        cast.child().toSql(), expression.getDataType(),
+                        cast.child().nullable()));
             } else if (expression instanceof Slot) {
-                newOutputs.add(new SlotReference(
-                        expression.toSql(), expression.getDataType(), 
expression.nullable()));
+                Slot slot = ((Slot) expression);

Review Comment:
   is there any diff?



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to