Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
eldenmoon committed Apr 22, 2024
1 parent fb359af commit b2e90a7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
15 changes: 9 additions & 6 deletions be/src/vec/columns/column_object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<const DataTypeNullable&>(*least_common_base_type).get_nested_type();
is_nullable ? static_cast<const DataTypeNullable&>(*least_common_base_type)
.get_nested_type()
: least_common_base_type;
const auto& nested_base_type =
static_cast<const DataTypeNullable&>(*base_type).get_nested_type();
is_nullable ? static_cast<const DataTypeNullable&>(*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));
Expand All @@ -421,8 +423,9 @@ void ColumnObject::Subcolumn::insert(Field field, FieldInfo info) {
get_least_supertype<LeastSupertypeOnError::Jsonb>(
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));
Expand Down
2 changes: 1 addition & 1 deletion regression-test/suites/variant_p0/concurrent_insert.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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}"""
}

0 comments on commit b2e90a7

Please sign in to comment.