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

feat: Add map_from_entries Spark function #11934

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

PHILO-HE
Copy link
Contributor

@PHILO-HE PHILO-HE commented Dec 23, 2024

map_from_entries in Spark is similar as Presto but has difference in null handling.
If null entry exists in a array, it returns null for the whole array.
Examples:

Seq((1, "10"), (2, "20"), (3, null)),                 ---->        Map(1 -> "10", 2 -> "20", 3 -> null)
Seq((1, "10"), null, (2, "20")),                      ---->        null
Seq.empty,                                            ---->        Map.empty
null                                                  ---->        null

Spark doc: https://spark.apache.org/docs/latest/api/sql/#map_from_entries

This pr is based on #8692.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Dec 23, 2024
Copy link

netlify bot commented Dec 23, 2024

Deploy Preview for meta-velox canceled.

Name Link
🔨 Latest commit c7846f9
🔍 Latest deploy log https://app.netlify.com/sites/meta-velox/deploys/6768d4bee3c6570008c7691f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants