[Bug](array) fix array column core dump in get_shrinked_column as not check type (#33295)
* [Bug](array) fix array column core dump in get_shrinked_column as not check type * add function could_shrinked_column
This commit is contained in:
@ -455,18 +455,20 @@ ColumnPtr ColumnMap::replicate(const Offsets& offsets) const {
|
||||
return res;
|
||||
}
|
||||
|
||||
bool ColumnMap::could_shrinked_column() {
|
||||
return keys_column->could_shrinked_column() || values_column->could_shrinked_column();
|
||||
}
|
||||
|
||||
MutableColumnPtr ColumnMap::get_shrinked_column() {
|
||||
MutableColumns new_columns(2);
|
||||
|
||||
if (keys_column->is_column_string() || keys_column->is_column_array() ||
|
||||
keys_column->is_column_map() || keys_column->is_column_struct()) {
|
||||
if (keys_column->could_shrinked_column()) {
|
||||
new_columns[0] = keys_column->get_shrinked_column();
|
||||
} else {
|
||||
new_columns[0] = keys_column->get_ptr();
|
||||
}
|
||||
|
||||
if (values_column->is_column_string() || values_column->is_column_array() ||
|
||||
values_column->is_column_map() || values_column->is_column_struct()) {
|
||||
if (values_column->could_shrinked_column()) {
|
||||
new_columns[1] = values_column->get_shrinked_column();
|
||||
} else {
|
||||
new_columns[1] = values_column->get_ptr();
|
||||
|
||||
Reference in New Issue
Block a user