From b2e90a7fc1d05b98098f69d9da7854f5d1f429d7 Mon Sep 17 00:00:00 2001 From: eldenmoon <15605149486@163.com> Date: Mon, 22 Apr 2024 13:58:10 +0800 Subject: [PATCH] fix --- be/src/vec/columns/column_object.cpp | 15 +++++++++------ .../suites/variant_p0/concurrent_insert.groovy | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/be/src/vec/columns/column_object.cpp b/be/src/vec/columns/column_object.cpp index dc3f00d2c6b81e9..717942ed277ca42 100644 --- a/be/src/vec/columns/column_object.cpp +++ b/be/src/vec/columns/column_object.cpp @@ -400,15 +400,17 @@ void ColumnObject::Subcolumn::insert(Field field, FieldInfo info) { type_changed = true; } // Always expected nullable at present - if (!is_nothing(base_type)) { + if (is_nullable && !is_nothing(base_type)) { base_type = make_nullable(base_type); } const auto& least_common_base_type = least_common_type.get_base(); - DCHECK(base_type->is_nullable() && least_common_base_type->is_nullable()); const auto& nested_common_base_type = - static_cast(*least_common_base_type).get_nested_type(); + is_nullable ? static_cast(*least_common_base_type) + .get_nested_type() + : least_common_base_type; const auto& nested_base_type = - static_cast(*base_type).get_nested_type(); + is_nullable ? static_cast(*base_type).get_nested_type() + : base_type; if (data.empty()) { add_new_column_part(create_array_of_type(std::move(base_type), value_dim, is_nullable)); @@ -421,8 +423,9 @@ void ColumnObject::Subcolumn::insert(Field field, FieldInfo info) { get_least_supertype( DataTypes {std::move(nested_base_type), nested_common_base_type}, &base_type); type_changed = true; - // Always expected nullable at present - base_type = make_nullable(base_type); + if (is_nullable) { + base_type = make_nullable(base_type); + } if (!least_common_base_type->equals(*base_type)) { add_new_column_part( create_array_of_type(std::move(base_type), value_dim, is_nullable)); diff --git a/regression-test/suites/variant_p0/concurrent_insert.groovy b/regression-test/suites/variant_p0/concurrent_insert.groovy index 6538d062027aa08..0bbbfce789a3f3e 100644 --- a/regression-test/suites/variant_p0/concurrent_insert.groovy +++ b/regression-test/suites/variant_p0/concurrent_insert.groovy @@ -49,7 +49,7 @@ suite("regression_test_variant_concurrent_schema_update", ""){ t1.join() t2.join() t3.join() - qt_sql "sync" + sql "sync" qt_sql_1 "select * from var_concurrent order by k, cast(v as string), cast(v1 as string) limit 100" // qt_sql_3 """desc ${table_name}""" } \ No newline at end of file