juntaozhang commented on code in PR #4318:
URL: https://github.com/apache/calcite/pull/4318#discussion_r2049969063


##########
core/src/main/java/org/apache/calcite/sql/SqlCall.java:
##########
@@ -116,16 +116,21 @@ public int operandCount() {
         getOperandList());
   }
 
+  private boolean isParenthesesRequired(SqlWriter writer, int leftPrec, int 
rightPrec) {
+    final SqlOperator operator = getOperator();
+    boolean condition = leftPrec > operator.getLeftPrec()
+        || (operator.getRightPrec() <= rightPrec && (rightPrec != 0))
+        || writer.isAlwaysUseParentheses() && isA(SqlKind.EXPRESSION)
+        || (operator.getRightPrec() <= rightPrec + 1 && 
isA(SqlKind.COMPARISON));
+    return condition && !(getKind() == SqlKind.SET_SEMANTICS_TABLE);

Review Comment:
   👌



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