This is an automated email from the ASF dual-hosted git repository.

gabriellee pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 72408ac41d4 [Fix](expr) fix wrong debug string of cast expr and remove 
useless variable (#42489)
72408ac41d4 is described below

commit 72408ac41d47553c4c4c0a912f1ffc37b2aa5eb2
Author: zclllhhjj <zhaochan...@selectdb.com>
AuthorDate: Mon Oct 28 17:39:04 2024 +0800

    [Fix](expr) fix wrong debug string of cast expr and remove useless variable 
(#42489)
    
    before we print target type as the argument type.
    
    and for target type, we only need type itself. don't need dummy column.
---
 be/src/vec/exprs/vcast_expr.cpp | 7 ++-----
 be/src/vec/exprs/vcast_expr.h   | 1 -
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/be/src/vec/exprs/vcast_expr.cpp b/be/src/vec/exprs/vcast_expr.cpp
index 38f861add87..0e0241c76ff 100644
--- a/be/src/vec/exprs/vcast_expr.cpp
+++ b/be/src/vec/exprs/vcast_expr.cpp
@@ -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()});
@@ -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()) {
diff --git a/be/src/vec/exprs/vcast_expr.h b/be/src/vec/exprs/vcast_expr.h
index 3c03cb42ffb..f553d7682a3 100644
--- a/be/src/vec/exprs/vcast_expr.h
+++ b/be/src/vec/exprs/vcast_expr.h
@@ -61,7 +61,6 @@ private:
     std::string _target_data_type_name;
 
     DataTypePtr _cast_param_data_type;
-    ColumnPtr _cast_param;
 
     static const constexpr char* function_name = "CAST";
 };


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to