-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-23909][SQL] Add filter function. #21965
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
|
This is based on #21954. I'll update after it is merged. |
|
Test build #93983 has finished for PR 21965 at commit
|
|
@ueshin Please rebase it. Thanks! |
fe48510 to
ace19dd
Compare
|
cc @hvanhovell |
|
Test build #94088 has finished for PR 21965 at commit
|
|
Jenkins, retest this please. |
|
Test build #94107 has finished for PR 21965 at commit
|
|
retest this please |
| null | ||
| } else { | ||
| val f = functionForEval | ||
| val buffer = new mutable.ArrayBuffer[Any] |
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 am wondering if we should use the buffer builder with a size hint here? Or, alternatively manage the array ourself.
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.
Sounds good. I'll use the original length as a size hint.
| } | ||
| } | ||
|
|
||
| override def prettyName: String = "filter" |
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.
Is filter too generic? wdyt?
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.
Yeah, it might be. How about array_filter?
hvanhovell
left a comment
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.
LGTM - two small nits, that can be addressed later.
This reverts commit e79ebbd.
|
Test build #94119 has finished for PR 21965 at commit
|
|
retest this please |
|
Test build #94113 has finished for PR 21965 at commit
|
|
Test build #94124 has finished for PR 21965 at commit
|
|
Test build #94122 has finished for PR 21965 at commit
|
|
Test build #94128 has finished for PR 21965 at commit
|
|
Thanks! merging to master. |
What changes were proposed in this pull request?
This pr adds
filterfunction which filters the input array using the given predicate.How was this patch tested?
Added tests.