Class JsonWriteOptions
DataFrame.writeJson(String, JsonWriteOptions).
Mirrors a subset of DataFusion's DataFrameWriteOptions and the writer-side
JsonOptions. All setters return this for fluent chaining. Defaults: every field
null or empty (meaning the DataFusion default is used).
Path semantics: when singleFileOutput(boolean) is true, the path passed to
writeJson is the literal output filename. When left unset (the default) and there are no
partition columns, the path is treated as a directory that DataFusion populates with one or more
part-files.
The output is always newline-delimited JSON (NDJSON). DataFusion's JSON writer does not emit the bracketed array form, so there is no toggle for it here.
Compression reuses FileCompressionType -- the same codec set (UNCOMPRESSED,
GZIP, BZIP2, XZ, ZSTD) the read side and the CSV writer accept.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionOutput compression codec.partitionCols(String... cols) Hive-style partition columns.singleFileOutput(boolean v) Whentrue, write to a single file at the supplied path.
-
Constructor Details
-
JsonWriteOptions
public JsonWriteOptions()
-
-
Method Details
-
singleFileOutput
Whentrue, write to a single file at the supplied path. When left unset (the default) and no partition columns are configured, the path is treated as a directory and DataFusion writes one or more part-files. -
partitionCols
Hive-style partition columns. Each column listed here is removed from the data rows and encoded into the directory layout (one subdirectory per distinct value). Mutually exclusive withsingleFileOutput(boolean)-- DataFusion rejects the combination at write time. -
fileCompressionType
Output compression codec. Defaults to uncompressed.
-