[MINOR][SQL][DOC] Fix to_json
example in function description and doc
## What changes were proposed in this pull request? This PR fixes the an example for `to_json` in doc and function description. - http://spark.apache.org/docs/2.3.0/api/sql/#to_json - `describe function extended` ## How was this patch tested? Pass the Jenkins with the updated test. Closes #22096 from dongjoon-hyun/minor_json. Authored-by: Dongjoon Hyun <dongjoon@apache.org> Signed-off-by: hyukjinkwon <gurwls223@apache.org>
This commit is contained in:
parent
3eb52092b3
commit
e2ab7deae7
|
@ -625,7 +625,7 @@ case class JsonToStructs(
|
|||
{"a":1,"b":2}
|
||||
> SELECT _FUNC_(named_struct('time', to_timestamp('2015-08-26', 'yyyy-MM-dd')), map('timestampFormat', 'dd/MM/yyyy'));
|
||||
{"time":"26/08/2015"}
|
||||
> SELECT _FUNC_(array(named_struct('a', 1, 'b', 2));
|
||||
> SELECT _FUNC_(array(named_struct('a', 1, 'b', 2)));
|
||||
[{"a":1,"b":2}]
|
||||
> SELECT _FUNC_(map('a', named_struct('b', 1)));
|
||||
{"a":{"b":1}}
|
||||
|
|
|
@ -24,7 +24,7 @@ Extended Usage:
|
|||
{"a":1,"b":2}
|
||||
> SELECT to_json(named_struct('time', to_timestamp('2015-08-26', 'yyyy-MM-dd')), map('timestampFormat', 'dd/MM/yyyy'));
|
||||
{"time":"26/08/2015"}
|
||||
> SELECT to_json(array(named_struct('a', 1, 'b', 2));
|
||||
> SELECT to_json(array(named_struct('a', 1, 'b', 2)));
|
||||
[{"a":1,"b":2}]
|
||||
> SELECT to_json(map('a', named_struct('b', 1)));
|
||||
{"a":{"b":1}}
|
||||
|
|
Loading…
Reference in a new issue