Marko Radoicic created SPARK-60715:
--------------------------------------

             Summary: Report aliased pipe AGGREGATE GROUP BY ordinals as syntax 
errors
                 Key: SPARK-60715
                 URL: https://issues.apache.org/jira/browse/SPARK-60715
             Project: Spark
          Issue Type: Bug
          Components: SQL
    Affects Versions: 4.4.0
            Reporter: Marko Radoicic


Follow-up to SPARK-60239. With spark.sql.groupByOrdinal=true (the default), 
pipe AGGREGATE rejects an aliased integer-literal grouping ordinal, such as 
{{TABLE t |> AGGREGATE sum(x) AS s GROUP BY 2 AS grp}}. SPARK-60239 reported 
this with UNSUPPORTED_FEATURE.PIPE_OPERATOR_AGGREGATE_UNSUPPORTED_CASE 
("aliases on GROUP BY ordinals"). Regular GROUP BY rejects any alias on a 
grouping expression with PARSE_SYNTAX_ERROR.

This ticket changes the pipe AGGREGATE error to PARSE_SYNTAX_ERROR (SQLSTATE 
42601), with the alias source text as the error parameter, matching regular 
GROUP BY. Bare ordinals and aliases on other grouping expressions are 
unchanged. The legacy config spark.sql.legacy.allowAliasedPipeAggregateOrdinals 
still applies.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to