Skip to content

[SPARK-21602][R] Add map_keys and map_values functions to R#18809

Closed
HyukjinKwon wants to merge 2 commits intoapache:masterfrom
HyukjinKwon:map-keys-values-r
Closed

[SPARK-21602][R] Add map_keys and map_values functions to R#18809
HyukjinKwon wants to merge 2 commits intoapache:masterfrom
HyukjinKwon:map-keys-values-r

Conversation

@HyukjinKwon
Copy link
Member

What changes were proposed in this pull request?

This PR adds map_values and map_keys to R API.

> df <- createDataFrame(cbind(model = rownames(mtcars), mtcars))
> tmp <- mutate(df, v = create_map(df$model, df$cyl))
> head(select(tmp, map_keys(tmp$v)))
        map_keys(v)
1         Mazda RX4
2     Mazda RX4 Wag
3        Datsun 710
4    Hornet 4 Drive
5 Hornet Sportabout
6           Valiant
> head(select(tmp, map_values(tmp$v)))
  map_values(v)
1             6
2             6
3             4
4             6
5             8
6             6

How was this patch tested?

Manual tests and unit tests in R/pkg/tests/fulltests/test_sparkSQL.R

@HyukjinKwon
Copy link
Member Author

cc @felixcheung, could you take a look when you have some time?

@SparkQA
Copy link

SparkQA commented Aug 2, 2017

Test build #80147 has finished for PR 18809 at commit d87f4c4.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@HyukjinKwon HyukjinKwon closed this Aug 2, 2017
@HyukjinKwon HyukjinKwon reopened this Aug 2, 2017
Copy link
Member

@felixcheung felixcheung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
@actuaryzhang would you like to review?

@actuaryzhang
Copy link
Contributor

LGTM

@HyukjinKwon
Copy link
Member Author

Thank you @felixcheung and @actuaryzhang.

@asfgit asfgit closed this in 97ba491 Aug 3, 2017
@HyukjinKwon
Copy link
Member Author

Merged to master.

@HyukjinKwon HyukjinKwon deleted the map-keys-values-r branch January 2, 2018 03:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Comments