github-actions[bot] commented on code in PR #62491:
URL: https://github.com/apache/doris/pull/62491#discussion_r3086730890


##########
be/src/core/data_type/data_type_array.cpp:
##########
@@ -48,7 +48,13 @@ 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_);
+    auto nested_type = std::dynamic_pointer_cast<const 
DataTypeNullable>(nullable_nested);
+    DORIS_CHECK(nested_type != nullptr);
+    nested = std::move(nested_type);
+    nested_as_base = nested;

Review Comment:
   `nested_as_base` now stores the nullable wrapper, so `get_default()` starts 
returning `[NULL]` for every array type because 
`DataTypeNullable::get_default()` is `Field()`. That default is used when BE 
backfills omitted values for non-nullable columns in 
partial-update/default-fill paths 
(`be/src/storage/tablet/base_tablet.cpp:1060`, 
`be/src/storage/partial_update_info.cpp:451`), so `ARRAY<INT>` can now be 
materialized as `[NULL]` instead of `[0]`. I think `nested_as_base` needs to 
preserve the original `nested_` type (or `remove_nullable(nested)`) while 
`nested` keeps the nullable execution invariant.



-- 
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]

Reply via email to