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

    https://github.com/apache/spark/pull/17192#discussion_r104886708
  
    --- Diff: 
sql/core/src/test/resources/sql-tests/results/json-functions.sql.out ---
    @@ -32,32 +34,40 @@ Usage: to_json(expr[, options]) - Returns a json string 
with a given struct valu
     -- !query 2
     select to_json(named_struct('a', 1, 'b', 2))
     -- !query 2 schema
    -struct<structtojson(named_struct(a, 1, b, 2)):string>
    +struct<structorarraytojson(named_struct(a, 1, b, 2)):string>
     -- !query 2 output
     {"a":1,"b":2}
     
     
     -- !query 3
     select to_json(named_struct('time', to_timestamp('2015-08-26', 
'yyyy-MM-dd')), map('timestampFormat', 'dd/MM/yyyy'))
     -- !query 3 schema
    -struct<structtojson(named_struct(time, to_timestamp('2015-08-26', 
'yyyy-MM-dd'))):string>
    +struct<structorarraytojson(named_struct(time, to_timestamp('2015-08-26', 
'yyyy-MM-dd'))):string>
     -- !query 3 output
     {"time":"26/08/2015"}
     
     
     -- !query 4
    -select to_json(named_struct('a', 1, 'b', 2), named_struct('mode', 
'PERMISSIVE'))
    +select to_json(array(named_struct('a', 1, 'b', 2)))
     -- !query 4 schema
    -struct<>
    +struct<structorarraytojson(array(named_struct(a, 1, b, 2))):string>
     -- !query 4 output
    -org.apache.spark.sql.AnalysisException
    -Must use a map() function for options;; line 1 pos 7
    +[{"a":1,"b":2}]
     
     
     -- !query 5
    -select to_json()
    +select to_json(named_struct('a', 1, 'b', 2), named_struct('mode', 
'PERMISSIVE'))
    --- End diff --
    
    This happened to look a bit weird but I had to add this in the middle of 
the sql file - 
https://github.com/apache/spark/pull/17192/files#diff-3b8a538abd658a260aa32c4aa593bed7R6
 to represent this is not the case of the error.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to