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.closed, path
Constructor and Description |
---|
StatsCollectingSingleFileWriter(org.apache.flink.api.common.serialization.BulkWriter.Factory<org.apache.flink.table.data.RowData> factory,
org.apache.flink.core.fs.Path path,
java.util.function.Function<T,org.apache.flink.table.data.RowData> converter,
org.apache.flink.table.types.logical.RowType writeSchema,
FileStatsExtractor fileStatsExtractor) |
Modifier and Type | Method and Description |
---|---|
FieldStats[] |
fieldStats() |
void |
write(T record)
Add only one record to this file writer.
|
abort, close, length, path, recordCount, writeImpl
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
result, write, write, write
public StatsCollectingSingleFileWriter(org.apache.flink.api.common.serialization.BulkWriter.Factory<org.apache.flink.table.data.RowData> factory, org.apache.flink.core.fs.Path path, java.util.function.Function<T,org.apache.flink.table.data.RowData> converter, org.apache.flink.table.types.logical.RowType writeSchema, @Nullable FileStatsExtractor fileStatsExtractor)
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 FieldStats[] fieldStats() throws IOException
IOException
Copyright © 2019–2023 The Apache Software Foundation. All rights reserved.