[
https://issues.apache.org/jira/browse/CALCITE-5624?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17708991#comment-17708991
]
Guillaume Massé commented on CALCITE-5624:
------------------------------------------
[https://ci-builds.apache.org/blue/organizations/jenkins/Calcite%2FCalcite-sonar/detail/PR-3141/3/pipeline#step-19-log-321]
Looks like all tests passes but one: the idempotency of the array query
constructor. (SqlUnParserTest.testArrayQueryConstructor).
{code:java}
SELECT ARRAY ((SELECT "X" FROM (VALUES ROW(1)) AS "X")) {code}
{code:java}
Caused by: java.lang.RuntimeException:
org.apache.calcite.sql.parser.SqlParseException: Query expression encountered
in illegal context
{code}
ArrayConstructor()
[https://github.com/apache/calcite/pull/3141/files#diff-e873041549333502af52ece8a1b34301ae5a059ff4719e9bddbaef48929e7047R4713-R4730]
I'm not too sure how to handle this case.
> Cannot parse array function for Spark Dialect
> ---------------------------------------------
>
> Key: CALCITE-5624
> URL: https://issues.apache.org/jira/browse/CALCITE-5624
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.34.0
> Reporter: Guillaume Massé
> Priority: Minor
> Labels: pull-request-available
> Time Spent: 1.5h
> Remaining Estimate: 0h
>
> The following query is valid in Apache Spark.
> {code:java}
> spark-shell
> scala> spark.sql("""select array(1, 2, 3)""")
> res1: org.apache.spark.sql.DataFrame = [array(1, 2, 3): array<int>]{code}
> However, it would fail to parse in Apache Calcite
>
> AtomicRowExpression should not have ArrayConstructor for Apache Spark. Arrays
> are constructed by calling the array function
> ([https://spark.apache.org/docs/latest/api/sql/index.html#array]).
>
> {code:java}
> array()
> array(1)
> array(1, 2, 3){code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)