-
Notifications
You must be signed in to change notification settings - Fork 246
feat: [1941-Part2]: Introduce map_to_list scalar function #2312
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
base: main
Are you sure you want to change the base?
feat: [1941-Part2]: Introduce map_to_list scalar function #2312
Conversation
@comphead / @andygrove/ @parthchandra split the second function. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2312 +/- ##
============================================
+ Coverage 56.12% 57.62% +1.49%
- Complexity 976 1297 +321
============================================
Files 119 147 +28
Lines 11743 13497 +1754
Branches 2251 2390 +139
============================================
+ Hits 6591 7777 +1186
- Misses 4012 4451 +439
- Partials 1140 1269 +129 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Sorry @rishvin it looks like some conflicts in there |
d90c182
to
da1a397
Compare
This failure looks unrelated to the PR changes. |
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.
Thanks @rishvin what exactly spark sql function this PR addresses?
I checked https://spark.apache.org/docs/latest/api/sql/search.html?q=map I dont see map_to_list
Are you referring to https://spark.apache.org/docs/latest/api/sql/#map_entries ?
If so this function already supported
Hey @comphead : This is not spark sql function. We are using it internally to support grouping on map type. I know there has been some confusion around Spark4.0+ when doing grouping on Today, writing only the equivalent But now passing These conversion are totally done in native code, localized to -- I checked the implementation in Datafusion, here, which has one difference. It doesn't carry forward the field names. It is creating key field with name The And when converting the list back to map, the original field and metadata is consumed to construct the map type back. This is done here. Retaining these metadata information is important, otherwise, we may run into schema mismatch issues. I ran into some schema related issue when implementing this. So, I think we may be able to use Let me know if you have any further questions and your thoughts around this. |
Which issue does this PR close?
Addresses Part of #1941
Rationale for this change
Introduces
map_to_list
which converts aMapArray
toListArray<Struct<K, V>
.This PR has been split from original PR #2221. Please see that for details.
What changes are included in this PR?
A new
map_to_list
physical function.How are these changes tested?
Added unit tests.