pavibhai commented on code in PR #1482:
URL: https://github.com/apache/orc/pull/1482#discussion_r1189243541
##########
java/core/src/java/org/apache/orc/impl/ParserUtils.java:
##########
@@ -281,7 +282,7 @@ public void visit(TypeDescription type, int posn) {
public static TypeDescription findSubtype(TypeDescription schema,
ParserUtils.StringPosition source,
boolean
isSchemaEvolutionCaseAware) {
- TypeFinder result = new TypeFinder(removeAcid(schema));
+ TypeFinder result = new TypeFinder(schema);
Review Comment:
I tried with the following to get the test to pass.
```diff
diff --git a/java/core/src/java/org/apache/orc/impl/ParserUtils.java
b/java/core/src/java/org/apache/orc/impl/ParserUtils.java
index 6491fb8ba..b56fa35b3 100644
--- a/java/core/src/java/org/apache/orc/impl/ParserUtils.java
+++ b/java/core/src/java/org/apache/orc/impl/ParserUtils.java
@@ -411,18 +411,22 @@ public class ParserUtils {
private final ColumnVector[] result;
private int resultIdx = 0;
- ColumnFinder(TypeDescription schema, VectorizedRowBatch batch, int
levels) {
+ ColumnFinder(TypeDescription schema, ColumnVector[] cols, int levels) {
if (schema.getCategory() == TypeDescription.Category.STRUCT) {
- top = batch.cols;
+ top = cols;
result = new ColumnVector[levels];
} else {
result = new ColumnVector[levels + 1];
- current = batch.cols[0];
+ current = cols[0];
top = null;
addResult(current);
}
}
+ ColumnFinder(TypeDescription schema, VectorizedRowBatch batch, int
levels) {
+ this(schema, batch.cols, levels);
+ }
+
private void addResult(ColumnVector vector) {
result[resultIdx] = vector;
resultIdx += 1;
@@ -459,7 +463,10 @@ public class ParserUtils {
boolean isCaseSensitive,
VectorizedRowBatch batch) {
List<String> names = ParserUtils.splitName(source);
- ColumnFinder result = new ColumnFinder(schema, batch, names.size());
+ TypeDescription schemaToUse = removeAcid(schema);
+ ColumnVector[] cols = SchemaEvolution.checkAcidSchema(schema)
+ ? ((StructColumnVector) batch.cols[batch.cols.length - 1]).fields :
batch.cols;
+ ColumnFinder result = new ColumnFinder(schemaToUse, cols, names.size());
findColumn(removeAcid(schema), names, isCaseSensitive, result);
return result.result;
}
```
--
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]