l4wei commented on code in PR #2938: URL: https://github.com/apache/calcite/pull/2938#discussion_r996677165
########## core/src/main/java/org/apache/calcite/sql/SqlCall.java: ########## @@ -118,7 +118,7 @@ public int operandCount() { final SqlDialect dialect = writer.getDialect(); if (leftPrec > operator.getLeftPrec() || (operator.getRightPrec() <= rightPrec && (rightPrec != 0)) - || writer.isAlwaysUseParentheses() && isA(SqlKind.EXPRESSION)) { + || writer.isAlwaysUseParentheses() && isA(SqlKind.EXPRESSION) && !writer.inWithBody()) { Review Comment: IMHO, SET_QUERY should not be a EXPRESSION. -- 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...@calcite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org