public class JsonFileWriter extends Object implements AutoCloseable
| Modifier and Type | Class and Description |
|---|---|
static class |
JsonFileWriter.JSONWriteConfig
Configuration POJO for writing JSON files.
|
| Constructor and Description |
|---|
JsonFileWriter(File outputFile)
Constructs a new writer that will output to
outputFile. |
JsonFileWriter(File outputFile,
JsonFileWriter.JSONWriteConfig config)
Constructs a new writer that will output to
outputFile with the given options. |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
static JsonFileWriter.JSONWriteConfig |
config() |
void |
start(Schema schema,
DictionaryProvider provider)
Writes out the "header" of the file including the schema and any dictionaries required.
|
void |
write(VectorSchemaRoot recordBatch)
Writes the record batch to the JSON file.
|
public JsonFileWriter(File outputFile) throws IOException
outputFile.IOExceptionpublic JsonFileWriter(File outputFile, JsonFileWriter.JSONWriteConfig config) throws IOException
outputFile with the given options.IOExceptionpublic static JsonFileWriter.JSONWriteConfig config()
public void start(Schema schema, DictionaryProvider provider) throws IOException
IOExceptionpublic void write(VectorSchemaRoot recordBatch) throws IOException
IOExceptionpublic void close()
throws IOException
close in interface AutoCloseableIOExceptionCopyright © 2024 The Apache Software Foundation. All rights reserved.