Skip to content

Commit e2ab7de

Browse files
dongjoon-hyunHyukjinKwon
authored andcommitted
[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 apache#22096 from dongjoon-hyun/minor_json. Authored-by: Dongjoon Hyun <[email protected]> Signed-off-by: hyukjinkwon <[email protected]>
1 parent 3eb5209 commit e2ab7de

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/jsonExpressions.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@ case class JsonToStructs(
625625
{"a":1,"b":2}
626626
> SELECT _FUNC_(named_struct('time', to_timestamp('2015-08-26', 'yyyy-MM-dd')), map('timestampFormat', 'dd/MM/yyyy'));
627627
{"time":"26/08/2015"}
628-
> SELECT _FUNC_(array(named_struct('a', 1, 'b', 2));
628+
> SELECT _FUNC_(array(named_struct('a', 1, 'b', 2)));
629629
[{"a":1,"b":2}]
630630
> SELECT _FUNC_(map('a', named_struct('b', 1)));
631631
{"a":{"b":1}}

sql/core/src/test/resources/sql-tests/results/json-functions.sql.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Extended Usage:
2424
{"a":1,"b":2}
2525
> SELECT to_json(named_struct('time', to_timestamp('2015-08-26', 'yyyy-MM-dd')), map('timestampFormat', 'dd/MM/yyyy'));
2626
{"time":"26/08/2015"}
27-
> SELECT to_json(array(named_struct('a', 1, 'b', 2));
27+
> SELECT to_json(array(named_struct('a', 1, 'b', 2)));
2828
[{"a":1,"b":2}]
2929
> SELECT to_json(map('a', named_struct('b', 1)));
3030
{"a":{"b":1}}

0 commit comments

Comments
 (0)