Skip to content

Commit 40bb515

Browse files
author
stczwd
committed
[SPARK-29444] change ignoreNullFields doc
1 parent 41384d4 commit 40bb515

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

python/pyspark/sql/readwriter.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -817,9 +817,8 @@ def json(self, path, mode=None, compression=None, dateFormat=None, timestampForm
817817
the default UTF-8 charset will be used.
818818
:param lineSep: defines the line separator that should be used for writing. If None is
819819
set, it uses the default value, ``\\n``.
820-
:param ignoreNullFields: whether to ignore null fields in column/struct
821-
during json generating. If None is set,
822-
it uses the default value, ``true``.
820+
:param ignoreNullFields: Whether to ignore null fields when generating JSON objects.
821+
If None is set, it uses the default value, ``true``.
823822
824823
>>> df.write.json(os.path.join(tempfile.mkdtemp(), 'data'))
825824
"""

sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1189,8 +1189,9 @@ object SQLConf {
11891189

11901190
val JSON_GENERATOR_IGNORE_NULL_FIELDS =
11911191
buildConf("spark.sql.jsonGenerator.ignoreNullFields")
1192-
.doc("Whether to ignore null fields in column/struct during json generating. " +
1193-
"If false, json generator will generate null in Column/Struct.")
1192+
.doc("Whether to ignore null fields when generating JSON objects in JSON data source and " +
1193+
"JSON functions such as to_json. " +
1194+
"If false, it generates null for null fields in JSON objects.")
11941195
.booleanConf
11951196
.createWithDefault(true)
11961197

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -687,8 +687,8 @@ final class DataFrameWriter[T] private[sql](ds: Dataset[T]) {
687687
* <li>`encoding` (by default it is not set): specifies encoding (charset) of saved json
688688
* files. If it is not set, the UTF-8 charset will be used. </li>
689689
* <li>`lineSep` (default `\n`): defines the line separator that should be used for writing.</li>
690-
* <li>`ignoreNullFields` (default `true`): whether to ignore null fields in column/struct
691-
* during json generating. </li>
690+
* <li>`ignoreNullFields` (default `true`): Whether to ignore null fields
691+
* when generating JSON objects. </li>
692692
* </ul>
693693
*
694694
* @since 1.4.0

0 commit comments

Comments
 (0)