Skip to content

Conversation

@MaxGekk
Copy link
Member

@MaxGekk MaxGekk commented Feb 7, 2022

What changes were proposed in this pull request?

In the PR, I propose to check the whole error messages of error classes in the test suites Query.*ErrorsSuite.

Why are the changes needed?

  1. To catch changes in error classes.
  2. To improve test coverage.
  3. Set user expectations from Spark's errors.
  4. The checks can be considered as documentation of error messages in tests.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

By running the modified test suites:

$ build/sbt "test:testOnly *QueryParsingErrorsSuite"
$ build/sbt "test:testOnly *QueryCompilationErrorsSuite"
$ build/sbt "test:testOnly *QueryCompilationErrorsDSv2Suite"
$ build/sbt "test:testOnly *QueryExecutionErrorsSuite"

@github-actions github-actions bot added the SQL label Feb 7, 2022
@MaxGekk MaxGekk changed the title [WIP][SPARK-38126][SQL] Check the whole message of error classes [SPARK-38126][SQL] Check the whole message of error classes Feb 7, 2022
@MaxGekk MaxGekk marked this pull request as ready for review February 7, 2022 09:40
@MaxGekk
Copy link
Member Author

MaxGekk commented Feb 7, 2022

@cloud-fan @imback82 @ivoson @SaurabhChawla100 @yutoacts @leesf Could you review this PR, please.

@MaxGekk MaxGekk changed the title [SPARK-38126][SQL] Check the whole message of error classes [SPARK-38126][SQL][TESTS] Check the whole message of error classes Feb 7, 2022
Dataset.ofRows(spark, plan)
}.message
assert(msg.contains("The feature is not supported: " +
assert(msg.matches("The feature is not supported: " +
Copy link
Contributor

Choose a reason for hiding this comment

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

is this a user-facing error? The test constructs logical plan directly which is not user-facing.

Copy link
Member Author

@MaxGekk MaxGekk Feb 7, 2022

Choose a reason for hiding this comment

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

The exception was introduced by #28572. @Ngone51 Can it be triggered by user code?

Probably, it would be nice to revise all existing error classes/exceptions, and check their visibility to users.

Copy link
Member Author

Choose a reason for hiding this comment

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

Opened SPARK-38131 for the task.

@MaxGekk
Copy link
Member Author

MaxGekk commented Feb 7, 2022

Merging to master. Thank you, @cloud-fan for review.

@MaxGekk MaxGekk closed this in 65c0bdf Feb 7, 2022
Copy link
Member

@HyukjinKwon HyukjinKwon left a comment

Choose a reason for hiding this comment

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

LGTM2

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.

3 participants