-
Notifications
You must be signed in to change notification settings - Fork 28.5k
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-33848][SQL][FOLLOWUP] Introduce allowList for push into (if / case) branches #30955
Conversation
case _: GetDateField | _: LastDay => true | ||
case _: ExtractIntervalPart => true | ||
case _: ArraySetLike => true | ||
case _ => false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's include ExtractValue
as well, which is common with nested fields.
@@ -548,41 +548,66 @@ object PushFoldableIntoBranches extends Rule[LogicalPlan] with PredicateHelper { | |||
foldables.nonEmpty && others.length < 2 | |||
} | |||
|
|||
// Not all UnaryExpression support push into (if / case) branches, e.g. Alias. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not all UnaryExpression can be pushed into (if / case) branches, e.g. Alias.
case _ => false | ||
} | ||
|
||
private def supportedBinaryExpression(e: BinaryExpression): Boolean = e match { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's add comments as well.
Kubernetes integration test starting |
Kubernetes integration test status failure |
Test build #133465 has finished for PR 30955 at commit
|
Kubernetes integration test starting |
Kubernetes integration test status success |
Test build #133475 has finished for PR 30955 at commit
|
Test build #133486 has finished for PR 30955 at commit
|
It's definitely not related to Spark R. I'm merging it to master, thanks! |
Looks a safer approach and late lgtm. side note: sorry for my late reply, but I think we'd be better to describe what's issue and how the PR fix it clearly in the PR description for better activity logs. At first I didn't understand what the potential bug was referring to and I found the previous discussion then: #30853 (comment) |
case _: BinaryComparison | _: StringPredicate | _: StringRegexExpression => true | ||
case _: BinaryArithmetic => true | ||
case _: BinaryMathExpression => true | ||
case _: AddMonths | _: DateAdd | _: DateAddInterval | _: DateDiff | _: DateSub => true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What the property should the expression have to be here? For example, can I add DateAddYMInterval
, TimestampAddYMInterval
and TimeAdd
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok. I opened the JIRA for that: SPARK-34841
What changes were proposed in this pull request?
Introduce allowList push into (if / case) branches to fix potential bug.
Why are the changes needed?
Fix potential bug.
Does this PR introduce any user-facing change?
No.
How was this patch tested?
Existing test.