Skip to content

Conversation

@gaoyajun02
Copy link
Contributor

What changes were proposed in this pull request?

Currently, references to grouping sets are reported as errors after aggregated expressions, e.g.

SELECT count(name) c, name
FROM VALUES ('Alice'), ('Bob') people(name)
GROUP BY name GROUPING SETS(name);

Error in query: expression 'people.name' is neither present in the group by, nor is it an aggregate function. Add to group by or wrap in first() (or first_value) if you don't care which value you get.;;

Why are the changes needed?

Fix the map anonymous function in the constructAggregateExprs function does not use underscores to avoid

Does this PR introduce any user-facing change?

No

How was this patch tested?

Unit tests.

…n should be replaced

Currently, references to grouping sets are reported as errors after aggregated expressions, e.g.
```
SELECT count(name) c, name
FROM VALUES ('Alice'), ('Bob') people(name)
GROUP BY name GROUPING SETS(name);
```
Error in query: expression 'people.`name`' is neither present in the group by, nor is it an aggregate function. Add to group by or wrap in first() (or first_value) if you don't care which value you get.;;

Fix the map anonymous function in the constructAggregateExprs function does not use underscores to avoid

No

Unit tests.

Closes apache#33574 from gaoyajun02/SPARK-36339.

Lead-authored-by: gaoyajun02 <[email protected]>
Co-authored-by: gaoyajun02 <[email protected]>
Signed-off-by: Wenchen Fan <[email protected]>
(cherry picked from commit 888f8f0)
@cloud-fan
Copy link
Contributor

ok to test

@cloud-fan
Copy link
Contributor

can we also add the test?

@SparkQA
Copy link

SparkQA commented Aug 6, 2021

Test build #142163 has started for PR 33669 at commit 5699bd2.

@SparkQA
Copy link

SparkQA commented Aug 6, 2021

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/46676/

@SparkQA
Copy link

SparkQA commented Aug 6, 2021

Kubernetes integration test status success
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/46676/

@gaoyajun02
Copy link
Contributor Author

Sorry for the missing UT, added

@SparkQA
Copy link

SparkQA commented Aug 7, 2021

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/46698/

@SparkQA
Copy link

SparkQA commented Aug 7, 2021

Kubernetes integration test status success
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/46698/

@SparkQA
Copy link

SparkQA commented Aug 7, 2021

Test build #142186 has finished for PR 33669 at commit 504fe8c.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

cloud-fan pushed a commit that referenced this pull request Aug 9, 2021
…gation should be replaced

### What changes were proposed in this pull request?

Currently, references to grouping sets are reported as errors after aggregated expressions, e.g.
```
SELECT count(name) c, name
FROM VALUES ('Alice'), ('Bob') people(name)
GROUP BY name GROUPING SETS(name);
```
Error in query: expression 'people.`name`' is neither present in the group by, nor is it an aggregate function. Add to group by or wrap in first() (or first_value) if you don't care which value you get.;;

### Why are the changes needed?

Fix the map anonymous function in the constructAggregateExprs function does not use underscores to avoid

### Does this PR introduce _any_ user-facing change?
No

### How was this patch tested?
Unit tests.

Closes #33669 from gaoyajun02/branch-3.0.

Authored-by: gaoyajun02 <[email protected]>
Signed-off-by: Wenchen Fan <[email protected]>
cloud-fan pushed a commit that referenced this pull request Aug 9, 2021
…gation should be replaced

Currently, references to grouping sets are reported as errors after aggregated expressions, e.g.
```
SELECT count(name) c, name
FROM VALUES ('Alice'), ('Bob') people(name)
GROUP BY name GROUPING SETS(name);
```
Error in query: expression 'people.`name`' is neither present in the group by, nor is it an aggregate function. Add to group by or wrap in first() (or first_value) if you don't care which value you get.;;

Fix the map anonymous function in the constructAggregateExprs function does not use underscores to avoid

No

Unit tests.

Closes #33669 from gaoyajun02/branch-3.0.

Authored-by: gaoyajun02 <[email protected]>
Signed-off-by: Wenchen Fan <[email protected]>
(cherry picked from commit e10cc78)
Signed-off-by: Wenchen Fan <[email protected]>
@cloud-fan
Copy link
Contributor

thanks, merging to 3.0/3.1!

@cloud-fan cloud-fan closed this Aug 9, 2021
flyrain pushed a commit to flyrain/spark that referenced this pull request Sep 21, 2021
…gation should be replaced

Currently, references to grouping sets are reported as errors after aggregated expressions, e.g.
```
SELECT count(name) c, name
FROM VALUES ('Alice'), ('Bob') people(name)
GROUP BY name GROUPING SETS(name);
```
Error in query: expression 'people.`name`' is neither present in the group by, nor is it an aggregate function. Add to group by or wrap in first() (or first_value) if you don't care which value you get.;;

Fix the map anonymous function in the constructAggregateExprs function does not use underscores to avoid

No

Unit tests.

Closes apache#33669 from gaoyajun02/branch-3.0.

Authored-by: gaoyajun02 <[email protected]>
Signed-off-by: Wenchen Fan <[email protected]>
(cherry picked from commit e10cc78)
Signed-off-by: Wenchen Fan <[email protected]>
(cherry picked from commit e1a549c)
Signed-off-by: Dongjoon Hyun <[email protected]>
fishcus pushed a commit to fishcus/spark that referenced this pull request Jan 12, 2022
…gation should be replaced

Currently, references to grouping sets are reported as errors after aggregated expressions, e.g.
```
SELECT count(name) c, name
FROM VALUES ('Alice'), ('Bob') people(name)
GROUP BY name GROUPING SETS(name);
```
Error in query: expression 'people.`name`' is neither present in the group by, nor is it an aggregate function. Add to group by or wrap in first() (or first_value) if you don't care which value you get.;;

Fix the map anonymous function in the constructAggregateExprs function does not use underscores to avoid

No

Unit tests.

Closes apache#33669 from gaoyajun02/branch-3.0.

Authored-by: gaoyajun02 <[email protected]>
Signed-off-by: Wenchen Fan <[email protected]>
(cherry picked from commit e10cc78)
Signed-off-by: Wenchen Fan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants