public class OrcBulkWriter extends Object implements FormatWriter
FormatWriter implementation that writes data in ORC format.| Constructor and Description |
|---|
OrcBulkWriter(Vectorizer<InternalRow> vectorizer,
org.apache.orc.Writer writer,
PositionOutputStream underlyingStream,
int batchSize) |
| Modifier and Type | Method and Description |
|---|---|
void |
addElement(InternalRow element)
Adds an element to the encoder.
|
void |
close() |
boolean |
reachTargetSize(boolean suggestedCheck,
long targetSize)
Check if the writer has reached the
targetSize. |
public OrcBulkWriter(Vectorizer<InternalRow> vectorizer, org.apache.orc.Writer writer, PositionOutputStream underlyingStream, int batchSize)
public void addElement(InternalRow element) 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 FormatWriterelement - 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.