public class ParquetBulkWriter extends Object implements FormatWriter
FormatWriter implementation that wraps a ParquetWriter.| Constructor and Description |
|---|
ParquetBulkWriter(ParquetWriter<InternalRow> parquetWriter)
Creates a new ParquetBulkWriter wrapping the given ParquetWriter.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addElement(InternalRow datum)
Adds an element to the encoder.
|
void |
close() |
boolean |
reachTargetSize(boolean suggestedCheck,
long targetSize)
Check if the writer has reached the
targetSize. |
public ParquetBulkWriter(ParquetWriter<InternalRow> parquetWriter)
parquetWriter - The ParquetWriter to write to.public void addElement(InternalRow datum) throws IOException
FormatWriterIt may be that adding this element fills up an internal buffer and causes the encoding and flushing of a batch of internally buffered elements.
addElement in interface FormatWriterdatum - The element to add.IOException - Thrown, if the element cannot be added to the encoder, or if the output
stream throws an exception.public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic boolean reachTargetSize(boolean suggestedCheck,
long targetSize)
throws IOException
FormatWritertargetSize.reachTargetSize in interface FormatWritersuggestedCheck - Whether it needs to be checked, but subclasses can also decide whether
to check it themselves.targetSize - The size of the target.IOException - Thrown if calculating the length fails.Copyright © 2023–2024 The Apache Software Foundation. All rights reserved.