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


##########
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
+          && ((SqlUnnestOperator) call.getOperator()).withOrdinality) {
+        writer.keyword("POSEXPLODE");

Review Comment:
   this one is actually more tricky: I think the ordinality argument is swapped 
with the data argument in spark, So doing this won't work. You really have to 
rewrite the plan. You will have to validate this using a real program with data 
on spark.



##########
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:
   That is mostly useful if he wants to support it in input programs; here he 
wants to use it when outputting SQL.



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