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 ad11855
Showing 1 changed file with 9 additions and 6 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

0 comments on commit ad11855

Please sign in to comment.