github-actions[bot] commented on code in PR #62491:
URL: https://github.com/apache/doris/pull/62491#discussion_r3078960391
##########
be/src/core/data_type/data_type_array.cpp:
##########
@@ -48,7 +48,12 @@ namespace ErrorCodes {
extern const int NUMBER_OF_ARGUMENTS_DOESNT_MATCH;
}
-DataTypeArray::DataTypeArray(const DataTypePtr& nested_) : nested {nested_} {}
+DataTypeArray::DataTypeArray(const DataTypePtr& nested_) {
+ DataTypePtr nullable_nested = make_nullable(nested_);
Review Comment:
Wrapping every array child in `make_nullable()` changes the type metadata
you export later. `DataTypeArray::to_protobuf()` uses `nested->is_nullable()`,
and FE's `FoldConstantRuleOnBE.convertToNereidsType()` reconstructs `ArrayType`
from that flag. After this change, a folded expression like `CAST([1] AS
ARRAY<INT NOT NULL>)` will round-trip back to FE as `ARRAY<INT>` because BE now
always reports `contains_null=true`. FE still treats `ArrayType.containsNull`
as part of exact type matching, so this is a real regression in the
constant-folding path, not just an internal invariant cleanup. Please preserve
the original child-nullability flag on the exported type metadata path or add a
compatibility fix/test for it.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]