dssysolyatin commented on code in PR #4601:
URL: https://github.com/apache/calcite/pull/4601#discussion_r2462971097


##########
core/src/main/java/org/apache/calcite/sql/dialect/SparkSqlDialect.java:
##########
@@ -155,6 +156,20 @@ public SparkSqlDialect(SqlDialect.Context context) {
     case POSITION:
       SqlUtil.unparseFunctionSyntax(SqlStdOperatorTable.POSITION, writer, 
call, false);
       break;
+    case UNNEST:
+      if (call.getOperator() instanceof SqlUnnestOperator

Review Comment:
   Add two separate operators in SqlLibraryOperators: one for `explode` and one 
for `posexplode`
   
   And use it like:
   ```
   if (call.getOperator() instanceof SqlUnnestOperator && ((SqlUnnestOperator) 
call.getOperator()).withOrdinality ) {
     SqlCall posexplodeCall = SqlLibraryOperators.POSEXPLODE
              .createCall(SqlParserPos.ZERO, call.getOperandList());
         super.unparseCall(writer, posexplodeCall, leftPrec, rightPrec);
   } else {
     SqlCall explodeCall = SqlLibraryOperators.EXPLODE
              .createCall(SqlParserPos.ZERO, call.getOperandList());
         super.unparseCall(writer, explodeCall, leftPrec, rightPrec);
   
   }
   



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