Skip to content

Commit

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

(#41775)

Co-authored-by: Mryange <[email protected]>
  • Loading branch information
eldenmoon and Mryange authored Oct 24, 2024
1 parent ecbd135 commit 37b377f
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 @@ -148,8 +148,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 37b377f

Please sign in to comment.