This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch branch-4.1
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-4.1 by this push:
new 67ea11c6c6b branch-4.1: [fix](variant) Recognize nullable array
elements as NestedGroup types #66196 (#66202)
67ea11c6c6b is described below
commit 67ea11c6c6bac5eda75d781c8bb9598e218ef4dc
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Thu Jul 30 09:19:16 2026 +0800
branch-4.1: [fix](variant) Recognize nullable array elements as NestedGroup
types #66196 (#66202)
Cherry-picked from #66196
Co-authored-by: lihangyu <[email protected]>
---
be/src/core/column/column_variant.cpp | 3 +++
be/test/core/column/column_variant_test.cpp | 8 ++++++++
2 files changed, 11 insertions(+)
diff --git a/be/src/core/column/column_variant.cpp
b/be/src/core/column/column_variant.cpp
index 7382c2cad4f..1efeb159b2a 100644
--- a/be/src/core/column/column_variant.cpp
+++ b/be/src/core/column/column_variant.cpp
@@ -145,6 +145,9 @@ size_t get_number_of_dimensions(const IDataType& type) {
// which indicates NG-originated array<object> data.
bool is_nested_group_type(const DataTypePtr& type) {
auto base = get_base_type_of_array(type);
+ if (get_number_of_dimensions(*type) > 0) {
+ base = remove_nullable(base);
+ }
return typeid_cast<const DataTypeVariant*>(base.get()) != nullptr;
}
diff --git a/be/test/core/column/column_variant_test.cpp
b/be/test/core/column/column_variant_test.cpp
index 0ab96111075..b7c901c8c71 100644
--- a/be/test/core/column/column_variant_test.cpp
+++ b/be/test/core/column/column_variant_test.cpp
@@ -3623,6 +3623,14 @@ TEST_F(ColumnVariantTest, subcolumn_finalize_and_insert)
{
array_subcolumn.finalize();
}
+TEST(ColumnVariantNestedGroupTypeTest, nullable_array_element_is_recognized) {
+ EXPECT_TRUE(is_nested_group_type(ColumnVariant::NESTED_TYPE));
+
+ auto variant = std::make_shared<DataTypeVariant>(0, false);
+ EXPECT_TRUE(is_nested_group_type(variant));
+ EXPECT_FALSE(is_nested_group_type(make_nullable(variant)));
+}
+
TEST_F(ColumnVariantTest, deserialize_mixed_array_elements) {
ColumnVariant::Subcolumn subcolumn(0, true /* is_nullable */, false /*
is_root */);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]