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, outputBytes, path| Constructor and Description |
|---|
StatsCollectingSingleFileWriter(FileIO fileIO,
FileWriterContext context,
Path path,
java.util.function.Function<T,InternalRow> converter,
RowType rowType,
boolean asyncWrite) |
| Modifier and Type | Method and Description |
|---|---|
SimpleColStats[] |
fieldStats(long fileSize) |
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, FileWriterContext context, Path path, java.util.function.Function<T,InternalRow> converter, RowType rowType, 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(long fileSize) throws IOException
IOExceptionCopyright © 2023–2025 The Apache Software Foundation. All rights reserved.