File tree Expand file tree Collapse file tree
sql/core/src/main/scala/org/apache/spark/sql Expand file tree Collapse file tree Original file line number Diff line number Diff line change 198198# ' }
199199# ' @param ... additional argument(s). In \code{to_json} and \code{from_json}, this contains
200200# ' additional named properties to control how it is converted, accepts the same
201- # ' options as the JSON data source. In \code{arrays_zip}, this contains additional
202- # ' Columns of arrays to be merged.
201+ # ' options as the JSON data source. Additionally \code{to_json} supports the "pretty"
202+ # ' option which enables pretty JSON generation. In \code{arrays_zip}, this contains
203+ # ' additional Columns of arrays to be merged.
203204# ' @name column_collection_functions
204205# ' @rdname column_collection_functions
205206# ' @family collection functions
Original file line number Diff line number Diff line change @@ -2295,7 +2295,9 @@ def to_json(col, options={}):
22952295 into a JSON string. Throws an exception, in the case of an unsupported type.
22962296
22972297 :param col: name of column containing a struct, an array or a map.
2298- :param options: options to control converting. accepts the same options as the JSON datasource
2298+ :param options: options to control converting. accepts the same options as the JSON datasource.
2299+ Additionally the function supports the `pretty` option which enables
2300+ pretty JSON generation.
22992301
23002302 >>> from pyspark.sql import Row
23012303 >>> from pyspark.sql.types import *
Original file line number Diff line number Diff line change @@ -3619,6 +3619,8 @@ object functions {
36193619 * @param e a column containing a struct, an array or a map.
36203620 * @param options options to control how the struct column is converted into a json string.
36213621 * accepts the same options and the json data source.
3622+ * Additionally the function supports the `pretty` option which enables
3623+ * pretty JSON generation.
36223624 *
36233625 * @group collection_funcs
36243626 * @since 2.1.0
@@ -3635,6 +3637,8 @@ object functions {
36353637 * @param e a column containing a struct, an array or a map.
36363638 * @param options options to control how the struct column is converted into a json string.
36373639 * accepts the same options and the json data source.
3640+ * Additionally the function supports the `pretty` option which enables
3641+ * pretty JSON generation.
36383642 *
36393643 * @group collection_funcs
36403644 * @since 2.1.0
You can’t perform that action at this time.
0 commit comments