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-38104][SQL] Migrate parsing errors of window into the new error framework #35718

Closed
wants to merge 3 commits into from

Conversation

yutoacts
Copy link
Contributor

@yutoacts yutoacts commented Mar 3, 2022

What changes were proposed in this pull request?

In this PR, I migrated parsing errors of window listed below into the new error framework.

  • repetitiveWindowDefinitionError
  • invalidWindowReferenceError
  • cannotResolveWindowReferenceError

Why are the changes needed?

Porting the parsing errors of window into the new error framework should improve user experience with Spark SQL.

Does this PR introduce any user-facing change?

Yes, it changes the error message.

How was this patch tested?

$ build/sbt "test:testOnly *QueryParsingErrorsSuite"

@github-actions github-actions bot added the SQL label Mar 3, 2022
@yutoacts
Copy link
Contributor Author

yutoacts commented Mar 3, 2022

@MaxGekk Could you review this? Thanks in advance.

@yutoacts
Copy link
Contributor Author

yutoacts commented Mar 4, 2022

Also cc @cloud-fan

Copy link
Member

@MaxGekk MaxGekk left a comment

Choose a reason for hiding this comment

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

LGTM except of a comment.

|""".stripMargin)
}

test("SPARK:38104: INVALID_SQL_SYNTAX- invalid window reference") {
Copy link
Member

Choose a reason for hiding this comment

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

Please, follow the existing convention for test titles in the file:

Suggested change
test("SPARK:38104: INVALID_SQL_SYNTAX- invalid window reference") {
test("INVALID_SQL_SYNTAX: invalid window reference") {

Copy link
Contributor Author

@yutoacts yutoacts Mar 6, 2022

Choose a reason for hiding this comment

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

@MaxGekk thanks for the review. fixed.

@MaxGekk
Copy link
Member

MaxGekk commented Mar 7, 2022

@yutoacts The failure is related to your changes:

[info] - window.sql *** FAILED *** (5 seconds, 833 milliseconds)
[info]   window.sql
[info]   Expected "...ser.ParseException
[info]   
[info]   [The definition of window 'w' is repetitive](line 8, pos 0)
[info]   
[info]   == ...", but got "...ser.ParseException
[info]   
[info]   [Invalid SQL syntax: The definition of window 'w' is repetitive.](line 8, pos 0)

Could you fix it, please.

@MaxGekk
Copy link
Member

MaxGekk commented Mar 7, 2022

+1, LGTM. Merging to master.
Thank you, @yutoacts.

@MaxGekk MaxGekk closed this in 60d3de1 Mar 7, 2022
@yutoacts yutoacts deleted the SPARK-38104 branch March 8, 2022 07:02
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.

2 participants