You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Wenchen Fan (Jira)" <ji...@apache.org> on 2021/07/28 05:36:00 UTC
[jira] [Resolved] (SPARK-36275) ResolveAggregateFunctions should
work with nested fields
[ https://issues.apache.org/jira/browse/SPARK-36275?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Wenchen Fan resolved SPARK-36275.
---------------------------------
Fix Version/s: 3.2.0
Resolution: Fixed
Issue resolved by pull request 33498
[https://github.com/apache/spark/pull/33498]
> ResolveAggregateFunctions should work with nested fields
> --------------------------------------------------------
>
> Key: SPARK-36275
> URL: https://issues.apache.org/jira/browse/SPARK-36275
> Project: Spark
> Issue Type: Bug
> Components: SQL
> Affects Versions: 3.2.0
> Reporter: Allison Wang
> Assignee: Allison Wang
> Priority: Major
> Fix For: 3.2.0
>
>
> A sort after Aggregate can fail to resolve if it contains nested fields. For example
> {code:java}
> SELECT c.x, SUM(c.y)
> FROM VALUES NAMED_STRUCT('x', 'A', 'y', 1), NAMED_STRUCT('x', 'A', 'y', 2) AS t(c)
> GROUP BY c.x
> ORDER BY c.x
> {code}
> Error:
> {code}
> org.apache.spark.sql.AnalysisException: cannot resolve 'c.x' given input columns: [sum(c.y), x]; line 5 pos 9;
> 'Sort ['c.x ASC NULLS FIRST], true
> +- Aggregate [c#0.x], [c#0.x AS x#2, sum(c#0.y) AS sum(c.y)#5L]
> +- SubqueryAlias t
> +- LocalRelation [c#0]
> {code}
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org