T - type of records to write.R - type of result to produce after writing a file.public abstract class StatsCollectingSingleFileWriter<T,R> extends SingleFileWriter<T,R>
SingleFileWriter which also produces statistics for each written field.SingleFileWriter.AbortExecutorclosed, fileIO, path| Constructor and Description |
|---|
StatsCollectingSingleFileWriter(FileIO fileIO,
FormatWriterFactory factory,
Path path,
java.util.function.Function<T,InternalRow> converter,
RowType writeSchema,
SimpleStatsExtractor simpleStatsExtractor,
String compression,
SimpleColStatsCollector.Factory[] statsCollectors,
boolean asyncWrite) |
| Modifier and Type | Method and Description |
|---|---|
SimpleColStats[] |
fieldStats() |
void |
write(T record)
Add only one record to this file writer.
|
void |
writeBundle(BundleRecords bundle) |
abort, abortExecutor, close, path, reachTargetSize, recordCount, writeImplclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitresult, write, write, writepublic StatsCollectingSingleFileWriter(FileIO fileIO, FormatWriterFactory factory, Path path, java.util.function.Function<T,InternalRow> converter, RowType writeSchema, @Nullable SimpleStatsExtractor simpleStatsExtractor, String compression, SimpleColStatsCollector.Factory[] statsCollectors, boolean asyncWrite)
public void write(T record) throws IOException
FileWriterNOTE: If any exception occurs during writing, the writer should clean up useless files for the user.
write in interface FileWriter<T,R>write in class SingleFileWriter<T,R>record - to write.IOException - if encounter any IO error.public void writeBundle(BundleRecords bundle) throws IOException
writeBundle in class SingleFileWriter<T,R>IOExceptionpublic SimpleColStats[] fieldStats() throws IOException
IOExceptionCopyright © 2023–2025 The Apache Software Foundation. All rights reserved.