Skip to content

Conversation

@AngersZhuuuu
Copy link
Contributor

@AngersZhuuuu AngersZhuuuu commented Jan 5, 2021

What changes were proposed in this pull request?

In #22696 we support HAVING without GROUP BY means global aggregate
But since we treat having as Filter before, in this way will cause a lot of analyze error, after #28294 we use UnresolvedHaving to instead Filter to solve such problem, but break origin logical about treat SELECT 1 FROM range(10) HAVING true as SELECT 1 FROM range(10) WHERE true .
This PR fix this issue and add UT.

Why are the changes needed?

Keep consistent behavior of migration guide.

Does this PR introduce any user-facing change?

No

How was this patch tested?

added UT

@AngersZhuuuu
Copy link
Contributor Author

FYI @maropu @cloud-fan @viirya

@SparkQA
Copy link

SparkQA commented Jan 5, 2021

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

if (conf.getConf(SQLConf.LEGACY_HAVING_WITHOUT_GROUP_BY_AS_WHERE)) {
// If the legacy conf is set, treat HAVING without GROUP BY as WHERE.
withHavingClause(havingClause, createProject())
withHavingClauseAsWhere(havingClause, createProject())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you inline this func here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you inline this func here?

DONE

@maropu
Copy link
Member

maropu commented Jan 5, 2021

Could you file a new jira for this issue?

@AngersZhuuuu AngersZhuuuu changed the title [SPARK-25708][SQL][FOLLOW-UP] HAVING without GROUP BY means global aggregate [SPARK-34012][SQL] Keep behavior consistent when conf spark.sql.legacy.parser.havingWithoutGroupByAsWhere is true with migration guide Jan 5, 2021
@AngersZhuuuu
Copy link
Contributor Author

Could you file a new jira for this issue?

DONE

@SparkQA
Copy link

SparkQA commented Jan 5, 2021

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

Copy link
Contributor

@cloud-fan cloud-fan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch! Which version did we break this legacy config?

@SparkQA
Copy link

SparkQA commented Jan 5, 2021

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

@AngersZhuuuu
Copy link
Contributor Author

AngersZhuuuu commented Jan 5, 2021

good catch! Which version did we break this legacy config?

SInce #28294 backport to 2.4 too(#28294 (comment)), impacted version. should be 2.4/3.0/3.1/3.2

@SparkQA
Copy link

SparkQA commented Jan 5, 2021

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

@SparkQA
Copy link

SparkQA commented Jan 5, 2021

Test build #133673 has finished for PR 31039 at commit ea7188d.

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

@SparkQA
Copy link

SparkQA commented Jan 5, 2021

Test build #133682 has finished for PR 31039 at commit e591f9f.

  • This patch fails SparkR unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@github-actions github-actions bot added the SQL label Jan 5, 2021
@maropu maropu closed this in e279ed3 Jan 5, 2021
maropu pushed a commit that referenced this pull request Jan 5, 2021
…cy.parser.havingWithoutGroupByAsWhere` is true with migration guide

### What changes were proposed in this pull request?
In #22696 we support HAVING without GROUP BY means global aggregate
But since we treat having as Filter before, in this way will cause a lot of analyze error, after #28294 we use `UnresolvedHaving` to instead `Filter` to solve such problem, but break origin logical about treat `SELECT 1 FROM range(10) HAVING true` as `SELECT 1 FROM range(10) WHERE true`   .
This PR fix this issue and add UT.

### Why are the changes needed?
Keep consistent behavior of migration guide.

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

### How was this patch tested?
added UT

Closes #31039 from AngersZhuuuu/SPARK-25780-Follow-up.

Authored-by: angerszhu <[email protected]>
Signed-off-by: Takeshi Yamamuro <[email protected]>
(cherry picked from commit e279ed3)
Signed-off-by: Takeshi Yamamuro <[email protected]>
@maropu
Copy link
Member

maropu commented Jan 5, 2021

GA passed, so merged to master/branch-3.1. Could you make PRs for backporting this fix into branch-3.0/2.4? Thanks!

maropu pushed a commit that referenced this pull request Jan 6, 2021
…legacy.parser.havingWithoutGroupByAsWhere` is true with migration guide

### What changes were proposed in this pull request?
In #22696 we support HAVING without GROUP BY means global aggregate
But since we treat having as Filter before, in this way will cause a lot of analyze error, after #28294 we use `UnresolvedHaving` to instead `Filter` to solve such problem, but break origin logical about treat `SELECT 1 FROM range(10) HAVING true` as `SELECT 1 FROM range(10) WHERE true`   .
This PR fix this issue and add UT.

NOTE: This backport comes from #31039

### Why are the changes needed?
Keep consistent behavior of migration guide.

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

### How was this patch tested?
added UT

Closes #31050 from AngersZhuuuu/SPARK-34012-2.4.

Authored-by: angerszhu <[email protected]>
Signed-off-by: Takeshi Yamamuro <[email protected]>
maropu pushed a commit that referenced this pull request Jan 6, 2021
…legacy.parser.havingWithoutGroupByAsWhere` is true with migration guide

### What changes were proposed in this pull request?
In #22696 we support HAVING without GROUP BY means global aggregate
But since we treat having as Filter before, in this way will cause a lot of analyze error, after #28294 we use `UnresolvedHaving` to instead `Filter` to solve such problem, but break origin logical about treat `SELECT 1 FROM range(10) HAVING true` as `SELECT 1 FROM range(10) WHERE true`   .
This PR fix this issue and add UT.

NOTE: This backport comes from #31039

### Why are the changes needed?
Keep consistent behavior of migration guide.

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

### How was this patch tested?
added UT

Closes #31049 from AngersZhuuuu/SPARK-34012-3.0.

Authored-by: angerszhu <[email protected]>
Signed-off-by: Takeshi Yamamuro <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants