MasseGuillaume commented on PR #3056:
URL: https://github.com/apache/calcite/pull/3056#issuecomment-1411190050

   While implementing, I noticed:
   
   ArrayQueryConstructor are not valid in Spark:
   
   `spark-shell`
   
   ```scala
   spark.sql("select array(select 1)")
   org.apache.spark.sql.catalyst.parser.ParseException:
   extraneous input '1' expecting ')'(line 1, pos 20)
   
   == SQL ==
   select array(select 1)
   --------------------^^^
   
     at 
org.apache.spark.sql.catalyst.parser.ParseException.withCommand(ParseDriver.scala:266)
     at 
org.apache.spark.sql.catalyst.parser.AbstractSqlParser.parse(ParseDriver.scala:127)
     at 
org.apache.spark.sql.execution.SparkSqlParser.parse(SparkSqlParser.scala:51)
     at 
org.apache.spark.sql.catalyst.parser.AbstractSqlParser.parsePlan(ParseDriver.scala:77)
     at org.apache.spark.sql.SparkSession.$anonfun$sql$2(SparkSession.scala:616)
     at 
org.apache.spark.sql.catalyst.QueryPlanningTracker.measurePhase(QueryPlanningTracker.scala:111)
     at org.apache.spark.sql.SparkSession.$anonfun$sql$1(SparkSession.scala:616)
     at org.apache.spark.sql.SparkSession.withActive(SparkSession.scala:775)
     at org.apache.spark.sql.SparkSession.sql(SparkSession.scala:613)
     ... 47 elided
   ```
   
   Array literals are not uniform accross dialects,
   
   for example Google's BigQuery uses this syntax:
   
   ```sql
   SELECT [1, 2, 3]
   ```
   
https://cloud.google.com/bigquery/docs/reference/standard-sql/arrays#constructing_arrays


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