julianhyde commented on a change in pull request #1239: preliminary proposal to 
fix precedence issue in GROUPING SETS with node lists
URL: https://github.com/apache/calcite/pull/1239#discussion_r288314738
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/sql/fun/SqlRollupOperator.java
 ##########
 @@ -79,14 +81,14 @@ private static void unparseCube(SqlWriter writer, SqlCall 
call) {
             writer.startList(SqlWriter.FrameTypeEnum.SIMPLE, "(", ")");
         for (SqlNode operand2 : ((SqlCall) operand).getOperandList()) {
           writer.sep(",");
-          operand2.unparse(writer, 0, 0);
+          operand2.unparse(writer, PRECEDENCE + 1, PRECEDENCE + 1);
 
 Review comment:
   can you use `getLeftPrec()` and `getRightPrec()` (inherited from 
`SqlOperator`)? then you can remove `PRECEDENCE`.

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

Reply via email to