Github user MaxGekk commented on the issue:

    https://github.com/apache/spark/pull/21686
  
    > Does this actually work in SQL?
    
    Yes, it does. Please, have a look at the SQL test:
    
https://github.com/apache/spark/pull/21686/files#diff-3b8a538abd658a260aa32c4aa593bed7R41
    
    > How does it work when we don't have a data type that's a schema?
    
    We recently supported schema as any data type in DDL format: 
https://github.com/apache/spark/pull/21550 . The new function uses the same 
mechanism as we use for schema inferring when we read files. So, it can infer 
and return any data type (but not `MapType` for now) as string in DDL format. 
And `from_json()` can accept it due to the 
https://github.com/apache/spark/pull/21550 . @rxin If I didn't answer to your 
question, please, clarify what do you mean.


---

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

Reply via email to