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.
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
Check if a map contains a specific key [skip ci] #8209
Check if a map contains a specific key [skip ci] #8209
Changes from 5 commits
fc5ae49
cead0de
7d512f3
acadd4e
577ab5f
636c41d
5793bb9
de80502
323d85e
719aaa9
df7f753
7a6115f
141698e
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 there is a better alternative here. We have a
list<struct<key, value>>
column and we want to find whether or not each row contains the incoming key. That to me sounds likecudf::contains()
if we were passing alist(string)
column where the strings were just the keys. It should be possible to construct a fake column_view here that gives us this structure. Roughly:@mythrocks is my thinking here about
contains()
sound?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.
Thank you Dave, I've updated the code according to
cudf::contains()
.The only change here is I manully added a null_mask(0) for the contains_column. To make nulls count in all_aggregation.
Please help review, thanks!
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.
@nvdbaranec, that makes perfect sense. Thank you for the suggestion.
I'll need to examine the null mask issue more closely before I can 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.
Since: https://github.com/apache/spark/blob/master/sql/catalyst/src/main/scala/org/apache/spark/sql/types/MapType.scala#L27
this case seems not useful, but still keep it here since we manually added a null_mask(0) for null values.