guiyanakuang commented on a change in pull request #952:
URL: https://github.com/apache/orc/pull/952#discussion_r779386491
##########
File path: java/core/src/java/org/apache/orc/impl/WriterImpl.java
##########
@@ -683,20 +683,22 @@ public void addUserMetadata(String name, ByteBuffer
value) {
@Override
public void addRowBatch(VectorizedRowBatch batch) throws IOException {
+ InternalVectorizedRowBatch internalBatch =
InternalVectorizedRowBatch.encapsulation(batch);
+ int batchSize = internalBatch.size();
try {
// If this is the first set of rows in this stripe, tell the tree writers
// to prepare the stripe.
- if (batch.size != 0 && rowsInStripe == 0) {
+ if (batchSize != 0 && rowsInStripe == 0) {
treeWriter.prepareStripe(stripes.size() + 1);
}
if (buildIndex) {
// Batch the writes up to the rowIndexStride so that we can get the
// right size indexes.
int posn = 0;
- while (posn < batch.size) {
- int chunkSize = Math.min(batch.size - posn,
+ while (posn < batchSize) {
+ int chunkSize = Math.min(batchSize - posn,
rowIndexStride - rowsInIndex);
- treeWriter.writeRootBatch(batch, posn, chunkSize);
+ treeWriter.writeRootBatch(internalBatch, posn, chunkSize);
Review comment:
The test passed perfectly. Very nice implementation. I'll close the pr.
Wait for your pr and I can contribute test cases
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]