Github user goldmedal commented on a diff in the pull request:

    https://github.com/apache/spark/pull/19223#discussion_r138799591
  
    --- Diff: R/pkg/R/functions.R ---
    @@ -1715,7 +1717,15 @@ setMethod("to_date",
     #'
     #' # Converts an array of structs into a JSON array
     #' df2 <- sql("SELECT array(named_struct('name', 'Bob'), 
named_struct('name', 'Alice')) as people")
    -#' df2 <- mutate(df2, people_json = to_json(df2$people))}
    +#' df2 <- mutate(df2, people_json = to_json(df2$people))
    +#'
    +#' # Converts a map into a JSON object
    +#' df2 <- sql("SELECT map('name', 'Bob')) as people")
    +#' df2 <- mutate(df2, people_json = to_json(df2$people))
    +#'
    +#' # Converts an array of maps into a JSON array
    +#' df2 <- sql("SELECT array(map('name', 'Bob'), map('name', 'Alice')) as 
people")
    +#' df2 <- mutate(df2, people_json = to_json(df2$people))
    --- End diff --
    
    ok  Thanks for careful review :)


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to