Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix](expr) fix wrong debug string of cast expr and remove useless variable #42489

Merged
merged 1 commit into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions be/src/vec/exprs/vcast_expr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,11 @@ doris::Status VCastExpr::prepare(doris::RuntimeState* state, const doris::RowDes
// Using typeindex to indicate the datatype, not using type name because
// type name is not stable, but type index is stable and immutable
_cast_param_data_type = _target_data_type;
// Has to cast to int16_t or there will be compile error because there is no
// TypeIndexField
_cast_param = _cast_param_data_type->create_column_const_with_default_value(1);

ColumnsWithTypeAndName argument_template;
argument_template.reserve(2);
argument_template.emplace_back(nullptr, child->data_type(), child_name);
argument_template.emplace_back(_cast_param, _cast_param_data_type, _target_data_type_name);
argument_template.emplace_back(nullptr, _cast_param_data_type, _target_data_type_name);
_function = SimpleFunctionFactory::instance().get_function(
function_name, argument_template, _data_type,
{.enable_decimal256 = state->enable_decimal256()});
Expand Down Expand Up @@ -133,7 +130,7 @@ const std::string& VCastExpr::expr_name() const {

std::string VCastExpr::debug_string() const {
std::stringstream out;
out << "CastExpr(CAST " << _cast_param_data_type->get_name() << " to "
out << "CastExpr(CAST " << get_child(0)->data_type()->get_name() << " to "
<< _target_data_type->get_name() << "){";
bool first = true;
for (auto& input_expr : children()) {
Expand Down
1 change: 0 additions & 1 deletion be/src/vec/exprs/vcast_expr.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ class VCastExpr final : public VExpr {
std::string _target_data_type_name;

DataTypePtr _cast_param_data_type;
ColumnPtr _cast_param;

static const constexpr char* function_name = "CAST";
};
Expand Down
Loading