zratkai commented on code in PR #1482:
URL: https://github.com/apache/orc/pull/1482#discussion_r1182448433
##########
java/core/src/java/org/apache/orc/impl/ParserUtils.java:
##########
@@ -459,10 +459,31 @@ public static ColumnVector[]
findColumnVectors(TypeDescription schema,
boolean isCaseSensitive,
VectorizedRowBatch batch) {
List<String> names = ParserUtils.splitName(source);
- ColumnFinder result = new ColumnFinder(schema, batch, names.size());
+ ColumnFinder result = new ColumnFinder(schema,
removeAcidColumnsFromVectorizedRowBatch(schema, batch), names.size());
findColumn(removeAcid(schema), names, isCaseSensitive, result);
return result.result;
}
+
+ private static VectorizedRowBatch
removeAcidColumnsFromVectorizedRowBatch(TypeDescription schema,
VectorizedRowBatch batch) {
+ final int acidColumnOffset = 5;
+ if(SchemaEvolution.checkAcidSchema(schema)) {
+ VectorizedRowBatch vectorizedRowBatch = new
VectorizedRowBatch(batch.cols.length - acidColumnOffset, batch.size);
+ System.arraycopy(batch.selected, 0, vectorizedRowBatch.selected, 0,
vectorizedRowBatch.selected.length);
+ System.arraycopy(batch.projectedColumns, acidColumnOffset,
vectorizedRowBatch.projectedColumns, 0, batch.projectedColumns.length -
acidColumnOffset);
+ vectorizedRowBatch.setPartitionInfo(batch.getDataColumnCount(),
batch.getPartitionColumnCount());
+ vectorizedRowBatch.selectedInUse = batch.selectedInUse;
+ vectorizedRowBatch.endOfFile = batch.endOfFile;
+
+ StructColumnVector structColumnVector =
(StructColumnVector)(batch.cols[acidColumnOffset]);
+ ColumnVector[] columnVectors = new
ColumnVector[structColumnVector.fields.length];
+ for (int i = 0; i < columnVectors.length; i++) {
+ columnVectors[i] = structColumnVector.fields[i];
+ }
+ vectorizedRowBatch.cols = columnVectors;
+ return vectorizedRowBatch;
+ }
+ return batch;
Review Comment:
Changed the logic. Please check the PR.
--
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]