Skip to content

Commit

Permalink
[opt](function) Avoid create_column inside cast_column function (apac…
Browse files Browse the repository at this point in the history
…he#41775)

## Proposed changes

 In the cast function, we don't need to initialize the result column.


<!--Describe your changes.-->
  • Loading branch information
Mryange authored and eldenmoon committed Oct 24, 2024
1 parent dba6296 commit 1837029
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions be/src/vec/common/schema_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,7 @@ bool is_conversion_required_between_integers(const TypeIndex& lhs, const TypeInd
}

Status cast_column(const ColumnWithTypeAndName& arg, const DataTypePtr& type, ColumnPtr* result) {
ColumnsWithTypeAndName arguments {
arg, {type->create_column_const_with_default_value(1), type, type->get_name()}};
ColumnsWithTypeAndName arguments {arg, {nullptr, type, type->get_name()}};
auto function = SimpleFunctionFactory::instance().get_function("CAST", arguments, type);
if (!function) {
return Status::InternalError("Not found cast function {} to {}", arg.type->get_name(),
Expand Down

0 comments on commit 1837029

Please sign in to comment.