Skip to content

Commit f2d7b7e

Browse files
committed
Description of the pretty option
1 parent 051c8fd commit f2d7b7e

3 files changed

Lines changed: 10 additions & 3 deletions

File tree

R/pkg/R/functions.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,9 @@ NULL
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

python/pyspark/sql/functions.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff 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 *

sql/core/src/main/scala/org/apache/spark/sql/functions.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)