-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-20889][SparkR] Grouped documentation for COLLECTION column methods #18458
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
Conversation
|
Last part of this doc update. |
|
Test build #78816 has finished for PR 18458 at commit
|
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.
LGTM - a few very minor comments
| #' df2 <- sql("SELECT named_struct('name', 'Bob') as people") | ||
| #' df2 <- mutate(df2, people_json = to_json(df2$people)) | ||
| #' schema <- structType(structField("name", "string")) | ||
| #' head(select(df2, from_json(df2$people_json, schema)))} |
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 think it's worthwhile to keep dateFormat = "dd/MM/yyyy") in the example
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 for catching this. Added an example.
R/pkg/R/functions.R
Outdated
| #' @details | ||
| #' \code{from_json}: Parses a column containing a JSON string into a Column of \code{structType} | ||
| #' with the specified \code{schema} or array of \code{structType} if \code{as.json.array} is set | ||
| #' to \code{TRUE}. If the string is unparseable, the Column will contains the value NA. |
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.
btw, will contains the value NA. is very consistently documented. in this case this is right, but there are many other that says the value is null (note lower case) which isn't quite correct on the R side.
another project? :)
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.
Corrected the typo. Will consider updating null & NA in the future :)
R/pkg/R/functions.R
Outdated
| #' head(tmp2) | ||
| #' head(select(tmp, posexplode(tmp$v1))) | ||
| #' head(select(tmp, sort_array(tmp$v1))) | ||
| #' head(select(tmp, sort_array(tmp$v1, FALSE)))} |
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.
nit, let's improve this? I think in sort_array we could be more clear, eg. sort_array(tmp$v1, asc = FALSE)
|
Test build #78856 has finished for PR 18458 at commit
|
|
Test build #78869 has finished for PR 18458 at commit
|
|
Test build #78915 has finished for PR 18458 at commit
|
|
Test build #78949 has finished for PR 18458 at commit
|
|
@felixcheung This is the last set of this doc update. Once it gets in, I will do another pass to fix any styles or consistency issue. |
|
merged to master. thanks! |



What changes were proposed in this pull request?
Grouped documentation for column collection methods.