Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-39548][SQL] CreateView Command with a window clause query hit a wrong window definition not found issue #36947

Closed
wants to merge 1 commit into from

Conversation

amaliujia
Copy link
Contributor

@amaliujia amaliujia commented Jun 21, 2022

What changes were proposed in this pull request?

  1. In the inline CTE code path, fix a bug that top down style unresolved window expression check leads to mis-clarification of a defined window expression.
  2. Move unresolved window expression check in project to CheckAnalysis.

Why are the changes needed?

This bug fails a correct query.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

UT

@github-actions github-actions bot added the SQL label Jun 21, 2022
@amaliujia amaliujia changed the title [WIP] [WIP][SQL] moving unresolved window expression to check analysis phrase Jun 21, 2022
@amaliujia amaliujia changed the title [WIP][SQL] moving unresolved window expression to check analysis phrase [WIP][SQL] moving unresolved window expression validation to the CheckAnalysis phrase Jun 21, 2022
@amaliujia amaliujia changed the title [WIP][SQL] moving unresolved window expression validation to the CheckAnalysis phrase [SPARK-39548][SQL] moving unresolved window expression validation to the CheckAnalysis phrase Jun 21, 2022
@amaliujia amaliujia changed the title [SPARK-39548][SQL] moving unresolved window expression validation to the CheckAnalysis phrase [SPARK-39548][SQL] CreateView Command with a window clause query hit a wrong window definition not found issue Jun 21, 2022
@amaliujia
Copy link
Contributor Author

R: @cloud-fan

@@ -4449,6 +4449,28 @@ class SQLQuerySuite extends QueryTest with SharedSparkSession with AdaptiveSpark
""".stripMargin),
Seq(Row(2), Row(1)))
}

test("CreateView will make query go into inline CTE code path") {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will update this test case name after the initial review.

Copy link
Contributor

Choose a reason for hiding this comment

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

please add the JIRA id to test name

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@AmplabJenkins
Copy link

Can one of the admins verify this patch?

@cloud-fan cloud-fan closed this in 4718d59 Jun 23, 2022
cloud-fan pushed a commit that referenced this pull request Jun 23, 2022
…a wrong window definition not found issue

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

1. In the inline CTE code path, fix a bug that top down style unresolved window expression check leads to mis-clarification of a defined window expression.
2. Move unresolved window expression check in project to `CheckAnalysis`.

### Why are the changes needed?

This bug fails a correct query.

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

No.

### How was this patch tested?

UT

Closes #36947 from amaliujia/improvewindow.

Authored-by: Rui Wang <rui.wang@databricks.com>
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
(cherry picked from commit 4718d59)
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
cloud-fan pushed a commit that referenced this pull request Jun 23, 2022
…a wrong window definition not found issue

1. In the inline CTE code path, fix a bug that top down style unresolved window expression check leads to mis-clarification of a defined window expression.
2. Move unresolved window expression check in project to `CheckAnalysis`.

This bug fails a correct query.

No.

UT

Closes #36947 from amaliujia/improvewindow.

Authored-by: Rui Wang <rui.wang@databricks.com>
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
(cherry picked from commit 4718d59)
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
@amaliujia amaliujia deleted the improvewindow branch June 23, 2022 06:42
sunchao pushed a commit to sunchao/spark that referenced this pull request Jun 2, 2023
…a wrong window definition not found issue

1. In the inline CTE code path, fix a bug that top down style unresolved window expression check leads to mis-clarification of a defined window expression.
2. Move unresolved window expression check in project to `CheckAnalysis`.

This bug fails a correct query.

No.

UT

Closes apache#36947 from amaliujia/improvewindow.

Authored-by: Rui Wang <rui.wang@databricks.com>
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
(cherry picked from commit 4718d59)
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants