eldenmoon commented on code in PR #30153:
URL: https://github.com/apache/doris/pull/30153#discussion_r1467155766


##########
be/src/vec/common/schema_util.cpp:
##########
@@ -152,13 +152,31 @@ Status cast_column(const ColumnWithTypeAndName& arg, 
const DataTypePtr& type, Co
     Block tmp_block {arguments};
     size_t result_column = tmp_block.columns();
     auto ctx = FunctionContext::create_context(nullptr, {}, {});
+
+    // To prevent from null info lost, we should not call function since the 
function framework will wrap
+    // nullable to Variant instead of the root of Variant
+    // Nullable(Array(int)) -> Variant<Nullable(Array(int))>
+    if (WhichDataType(remove_nullable(type)).is_variant_type()) {
+        // set variant root column/type to from column/type
+        auto variant = ColumnObject::create(true /*always nullable*/);
+        CHECK(arg.column->is_nullable());

Review Comment:
   all the subcolumn is stored ad nullable



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