Github user HyukjinKwon commented on the issue:

    https://github.com/apache/spark/pull/22939
  
    Will make another PR after this gets merged to allow the cases below:
    
    
    ```r
    df <- sql("SELECT named_struct('name', 'Bob') as people")
    df <- mutate(df, people_json = to_json(df$people))
    head(select(df, from_json(df$people_json, 
schema_of_json(head(df)$people_json))))
    ```
    
    ```
      from_json(people_json)
    1                    Bob
    ```
    
    ```r
    df <- sql("SELECT named_struct('name', 'Bob') as people")
    df <- mutate(df, people_json = to_csv(df$people))
    head(select(df, from_csv(df$people_json, 
schema_of_csv(head(df)$people_json))))
    ```
    
    ```
      from_csv(people_json)
    1                   Bob
    ```


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to