[feature-wip](array-type) Add some regression tests for nested array (#12322)

#11392 made _input_block in each BetaRowsetReaders sharable. However, for some types (e.g. nested array with more than 1 depth), the _column_vector_batches in RowBlockV2 can be nested which means that there is a ColumnVectorBatch inside another ColumnVectorBatch. In this case, the data of inner ColumnVectorBatch
may be corrupted because the data of _input_block is copied shallowly to the _output_block.
This commit is contained in:
Adonis Ling
2022-09-05 14:05:24 +08:00
committed by GitHub
parent 3b104e334a
commit 8bfb89c100
5 changed files with 173 additions and 2 deletions

View File

@ -53,7 +53,7 @@ public class ArrayLiteral extends LiteralExpr {
}
}
if (itemType == Type.NULL || itemType == Type.INVALID) {
if (itemType == Type.INVALID) {
throw new AnalysisException("Invalid element type in ARRAY");
}

View File

@ -508,6 +508,10 @@ public abstract class Type {
}
return new ArrayType(itemCompatibleType, arrayType1.getContainsNull() || arrayType2.getContainsNull());
} else if (t1.isArrayType() && t2.isNull()) {
return t1;
} else if (t1.isNull() && t2.isArrayType()) {
return t2;
}
return ScalarType.INVALID;