java.lang.Object
org.apache.arrow.dataset.file.DatasetFileWriter
JNI-based utility to write datasets into files. It internally depends on C++ static method
FileSystemDataset::Write.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
write
(BufferAllocator allocator, ArrowReader reader, FileFormat format, String uri) Write the contents of an ArrowReader as a dataset, with default partitioning settings.static void
write
(BufferAllocator allocator, ArrowReader reader, FileFormat format, String uri, String[] partitionColumns, int maxPartitions, String baseNameTemplate) Write the contents of an ArrowReader as a dataset.
-
Constructor Details
-
DatasetFileWriter
public DatasetFileWriter()
-
-
Method Details
-
write
public static void write(BufferAllocator allocator, ArrowReader reader, FileFormat format, String uri, String[] partitionColumns, int maxPartitions, String baseNameTemplate) Write the contents of an ArrowReader as a dataset.- Parameters:
reader
- the datasource for writingformat
- target file formaturi
- target file urimaxPartitions
- maximum partitions to be included in written filespartitionColumns
- columns used to partition output files. Empty to disable partitioningbaseNameTemplate
- file name template used to make partitions. E.g. "dat_{i}", i is current partition ID around all written files.
-
write
public static void write(BufferAllocator allocator, ArrowReader reader, FileFormat format, String uri) Write the contents of an ArrowReader as a dataset, with default partitioning settings.- Parameters:
reader
- the datasource for writingformat
- target file formaturi
- target file uri
-