You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2020/06/15 03:30:12 UTC

[GitHub] [calcite] danny0405 commented on a change in pull request #2025: [CALCITE-4033] Does not produce parenthesized table expressions for U…

danny0405 commented on a change in pull request #2025:
URL: https://github.com/apache/calcite/pull/2025#discussion_r439913573



##########
File path: core/src/main/java/org/apache/calcite/sql/SqlCall.java
##########
@@ -97,7 +97,13 @@ public void unparse(
     if (leftPrec > operator.getLeftPrec()
         || (operator.getRightPrec() <= rightPrec && (rightPrec != 0))
         || writer.isAlwaysUseParentheses() && isA(SqlKind.EXPRESSION)) {
-      final SqlWriter.Frame frame = writer.startList("(", ")");
+      final SqlWriter.Frame frame;
+      if (operator instanceof SqlUnnestOperator) {
+        frame = writer.startList(SqlWriter.FrameTypeEnum.SIMPLE);
+      } else {

Review comment:
       Use `SqlKind.UNNEST` instead of `instanceOf`.




----------------------------------------------------------------
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:
users@infra.apache.org