[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:
@ -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");
|
||||
}
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
Reference in New Issue
Block a user