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.AbortExecutor
closed, 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, writeImpl
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
result, write, write, write
public 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
FileWriter
NOTE: 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>
IOException
public SimpleColStats[] fieldStats() throws IOException
IOException
Copyright © 2023–2024 The Apache Software Foundation. All rights reserved.