[fix](struct-type) fix struct subtype support (#17081)
1. Make sure all sub types which STRUCT supported work correctly; 2. remove unused variable `_need_validate_data`; 3. lazy init min or max decimal to support nested DecimalV2 column validate; Co-authored-by: cambyzju <zhuxiaoli01@baidu.com>
This commit is contained in:
@ -43,7 +43,7 @@ public class StructLiteral extends LiteralExpr {
|
||||
type = new StructType();
|
||||
children = new ArrayList<>();
|
||||
for (LiteralExpr expr : exprs) {
|
||||
if (!type.supportSubType(expr.getType())) {
|
||||
if (!expr.getType().isNull() && !type.supportSubType(expr.getType())) {
|
||||
throw new AnalysisException("Invalid element type in STRUCT.");
|
||||
}
|
||||
((StructType) type).addField(new StructField(expr.getType()));
|
||||
|
||||
Reference in New Issue
Block a user