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-47809][SQL] checkExceptionInExpression should check error for each codegen mode #45997

Closed
wants to merge 2 commits into from

Conversation

cloud-fan
Copy link
Contributor

@cloud-fan cloud-fan commented Apr 11, 2024

What changes were proposed in this pull request?

There is a bug in the test util checkExceptionInExpression. It may fail to catch bugs when codegen and non-codegen have different error behaviors. This PR fixes it by checking the error for each codegen mode.

This PR also fixes a small error wrapping issue in SubExprEvaluationRuntime (used by interpreted common subexpression elimination).

Why are the changes needed?

bug fix for test utils

Does this PR introduce any user-facing change?

no

How was this patch tested?

N/A

Was this patch authored or co-authored using generative AI tooling?

No

@github-actions github-actions bot added the SQL label Apr 11, 2024
@@ -170,18 +170,15 @@ trait ExpressionEvalHelper extends ScalaCheckDrivenPropertyChecks with PlanTestB
def checkException(eval: => Unit, testMode: String): Unit = {
val modes = Seq(CodegenObjectFactoryMode.CODEGEN_ONLY, CodegenObjectFactoryMode.NO_CODEGEN)
withClue(s"($testMode)") {
val e = intercept[T] {
for (fallbackMode <- modes) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

before, the test passes as long as one codegen mode throws the error.

@cloud-fan
Copy link
Contributor Author

cc @HyukjinKwon @dongjoon-hyun

Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

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

+1, LGTM (Pending CIs)

@cloud-fan cloud-fan changed the title [SPARK-47809][SQL][TEST] checkExceptionInExpression should check error for each codegen mode [SPARK-47809][SQL] checkExceptionInExpression should check error for each codegen mode Apr 11, 2024
@yaooqinn yaooqinn closed this in dedddf5 Apr 11, 2024
@yaooqinn
Copy link
Member

Merged to master.

Thank you @cloud-fan @dongjoon-hyun @HyukjinKwon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants