-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-17100] [SQL] fix Python udf in filter on top of outer join #15103
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
Conversation
|
Test build #65402 has finished for PR 15103 at commit
|
|
Test build #65502 has finished for PR 15103 at commit
|
| val emptyRow = new GenericInternalRow(attributes.length) | ||
| val v = BindReferences.bindReference(e, attributes).eval(emptyRow) | ||
| val boundE = BindReferences.bindReference(e, attributes) | ||
| if (boundE.find(_.isInstanceOf[Unevaluable]).isDefined) return 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.
It looks like there's a similar hasUnevaluableExpression check in the ConvertToLocalRelation optimizer rule, except that rule also carves out a special-case exception for AttributeReference (see #13418 (comment) for discussion).
I guess we don't want to do that exemption here, though, since we're actually having to evaluate the rule and the attribute reference won't be replaced before evaluation.
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.
Also I guess that the AttributeReferences should have been replaced following binding in the previous line, so this looks good to me.
|
LGTM |
|
Merging into master and 2.0 |
## What changes were proposed in this pull request? In optimizer, we try to evaluate the condition to see whether it's nullable or not, but some expressions are not evaluable, we should check that before evaluate it. ## How was this patch tested? Added regression tests. Author: Davies Liu <[email protected]> Closes #15103 from davies/udf_join. (cherry picked from commit d810415) Signed-off-by: Davies Liu <[email protected]>
## What changes were proposed in this pull request? In optimizer, we try to evaluate the condition to see whether it's nullable or not, but some expressions are not evaluable, we should check that before evaluate it. ## How was this patch tested? Added regression tests. Author: Davies Liu <[email protected]> Closes apache#15103 from davies/udf_join.
What changes were proposed in this pull request?
In optimizer, we try to evaluate the condition to see whether it's nullable or not, but some expressions are not evaluable, we should check that before evaluate it.
How was this patch tested?
Added regression tests.