[fix](function) fix result column is nullable type when fast execute (#19889)
This commit is contained in:
@ -154,7 +154,15 @@ bool VectorizedFnCall::fast_execute(FunctionContext* context, Block& block,
|
||||
|
||||
auto result_column =
|
||||
block.get_by_name(result_column_name).column->convert_to_full_column_if_const();
|
||||
block.replace_by_position(result, std::move(result_column));
|
||||
auto& result_info = block.get_by_position(result);
|
||||
if (result_info.type->is_nullable()) {
|
||||
block.replace_by_position(result,
|
||||
ColumnNullable::create(std::move(result_column),
|
||||
ColumnUInt8::create(input_rows_count, 0)));
|
||||
} else {
|
||||
block.replace_by_position(result, std::move(result_column));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@ -79,7 +79,8 @@ std::tuple<Block, ColumnNumbers> create_block_with_nested_columns(const Block& b
|
||||
res.insert({ColumnConst::create(nested_col, col.column->size()), nested_type,
|
||||
col.name});
|
||||
} else {
|
||||
LOG(FATAL) << "Illegal column for DataTypeNullable";
|
||||
LOG(FATAL) << "Illegal column= " << col.column->get_name()
|
||||
<< " for DataTypeNullable";
|
||||
}
|
||||
} else {
|
||||
res.insert(col);
|
||||
|
||||
Reference in New Issue
Block a user