Skip to content
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

Feature: Support map functions #15295

Open
3 of 6 tasks
b41sh opened this issue Apr 22, 2024 · 7 comments
Open
3 of 6 tasks

Feature: Support map functions #15295

b41sh opened this issue Apr 22, 2024 · 7 comments
Assignees
Labels
C-feature Category: feature good first issue Category: good first issue

Comments

@b41sh
Copy link
Member

b41sh commented Apr 22, 2024

Summary

  • MAP_CAT(<map1>, <map2>) Returns the concatenatation of two MAPs. #15337
  • MAP_CONTAINS_KEY(<key>, <map>) Determines whether the specified MAP contains the specified key. @hanxuanliang
  • MAP_DELETE(<map>, <key1>[, <key2>, ...]) Returns a MAP based on an existing MAP with one or more keys removed..
  • MAP_INSERT(<map>, <key>, <value>[, <updateFlag>]) Returns a new MAP consisting of the input MAP with a new key-value pair inserted (an existing key updated with a new value).
  • MAP_PICK(<map>, <key1>[, <key2>, ...]) or MAP_PICK(<map>, <array>) Returns a new MAP containing the specified key-value pairs from an existing MAP.
  • MAP_SIZE(<map>) Returns the size of a MAP.

Refer to the following documentations:
https://docs.snowflake.com/en/sql-reference/functions/map_cat
https://docs.snowflake.com/en/sql-reference/functions/map_contains_key
https://docs.snowflake.com/en/sql-reference/functions/map_delete
https://docs.snowflake.com/en/sql-reference/functions/map_insert
https://docs.snowflake.com/en/sql-reference/functions/map_pick
https://docs.snowflake.com/en/sql-reference/functions/map_size

@b41sh b41sh added C-feature Category: feature good first issue Category: good first issue labels Apr 22, 2024
@shamb0
Copy link
Contributor

shamb0 commented Apr 23, 2024

Hi @b41sh,

I am interested in taking on the implementation of the feature. If available, I would appreciate being assigned to this task.

Thank you for your consideration.

@b41sh
Copy link
Member Author

b41sh commented Apr 23, 2024

Hi, @shamb0 Thanks for your attention, you can pick the functions that interest you.

@hanxuanliang
Copy link
Contributor

I want to try map_contains_key

@forsaken628
Copy link
Contributor

https://arrow.apache.org/docs/python/generated/pyarrow.MapType.html#pyarrow.MapType.keys_sorted
Is this attribute not supported? If supported, there are more efficient algorithm implementations

@b41sh
Copy link
Member Author

b41sh commented May 9, 2024

I want to try map_contains_key

Hi @hanxuanliang Thank you for your interest, you can work on this function.

@b41sh
Copy link
Member Author

b41sh commented May 9, 2024

https://arrow.apache.org/docs/python/generated/pyarrow.MapType.html#pyarrow.MapType.keys_sorted Is this attribute not supported? If supported, there are more efficient algorithm implementations

currently, we don't support keys_sorted attribute, considering the compatibility of the previous data, we do not plan to modify it in the short term.

@vaibhawvipul
Copy link

I would like to work on MAP_PICK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature Category: feature good first issue Category: good first issue
Projects
None yet
Development

No branches or pull requests

5 participants