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-16278][SPARK-16279][SQL] Implement map_keys/map_values SQL functions #13967
Conversation
cc @rxin and @cloud-fan . |
Test build #61454 has finished for PR 13967 at commit
|
override def foldable: Boolean = child.foldable | ||
|
||
override def nullSafeEval(map: Any): Any = { | ||
map.asInstanceOf[MapData].valueArray().copy() |
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 if we don't call copy
here? It looks reasonable to copy, I'm just curious :)
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 actually didn't found the corresponding case. Is it safe?
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.
A similar one is GetStructField
, it can get an array
column from a row without copying it. Maybe it's safe to not copy here too. cc @davies
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 for confirming. That's nice.
Thank you for review, @rxin and @cloud-fan . |
Test build #61536 has finished for PR 13967 at commit
|
|
||
override def dataType: DataType = ArrayType(child.dataType.asInstanceOf[MapType].keyType) | ||
|
||
override def foldable: Boolean = child.foldable |
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.
this is the default of UnaryExpression
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.
Yep.
I added a For the removal from |
Test build #61553 has finished for PR 13967 at commit
|
LGTM, pending jenkins |
Test build #61584 has finished for PR 13967 at commit
|
Hi, @cloud-fan . |
Rebased to the master. |
Test build #61661 has finished for PR 13967 at commit
|
thanks, merging to master! |
Thank you, @cloud-fan and @rxin ! |
…ctions This PR adds `map_keys` and `map_values` SQL functions in order to remove Hive fallback. Pass the Jenkins tests including new testcases. Author: Dongjoon Hyun <dongjoon@apache.org> Closes #13967 from dongjoon-hyun/SPARK-16278. (cherry picked from commit 54b27c1) Signed-off-by: Reynold Xin <rxin@databricks.com>
What changes were proposed in this pull request?
This PR adds
map_keys
andmap_values
SQL functions in order to remove Hive fallback.How was this patch tested?
Pass the Jenkins tests including new testcases.