[AURON #2331] Detect unexpected fallback in expression tests#2332
Open
weimingdiit wants to merge 3 commits into
Open
[AURON #2331] Detect unexpected fallback in expression tests#2332weimingdiit wants to merge 3 commits into
weimingdiit wants to merge 3 commits into
Conversation
Signed-off-by: weimingdiit <weimingdiit@gmail.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR strengthens Auron’s Spark expression test framework by asserting that expressions expected to run natively do not silently fall back to vanilla Spark execution, helping catch native expression conversion regressions earlier.
Changes:
- Adds a no-fallback assertion path in
SparkExpressionTestsBasewhen the executed plan is not offloaded. - Uses
NativeConvertersto refine supported data type checks and to decide when fallback should be considered unexpected. - Introduces an overridable hook to allow known/intentional fallback cases in specific suites.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+303
to
+312
| private def canConvertExpressionToNative(expression: Expression): Boolean = { | ||
| try { | ||
| NativeConverters.convertExpr(expression) | ||
| true | ||
| } catch { | ||
| case _: NotImplementedError => false | ||
| case _: AssertionError => false | ||
| case NonFatal(_) => false | ||
| } | ||
| } |
Comment on lines
+286
to
+288
| protected def allowNativeExpressionFallback(expression: Expression): Boolean = { | ||
| Set.empty[Expression].contains(expression) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Closes #2331
Rationale for this change
Expression tests currently validate result correctness, but they do not fail when a supported expression unexpectedly falls back to Spark execution. This can hide native expression conversion regressions because Spark may still produce the correct result.
Auron should verify that expressions known to be convertible are actually offloaded to native execution.
What changes are included in this PR?
This PR adds a conservative no-fallback check to
SparkExpressionTestsBase.The new check:
NativeProjectBaseNativeConverters.convertExprto decide whether an expression is expected to be convertibleAre there any user-facing changes?
No.
How was this patch tested?
UT.