From da84cf93ee054acbfe8bb7f50f0ddba5a31ebb40 Mon Sep 17 00:00:00 2001 From: kangkaisen Date: Wed, 8 Dec 2021 16:25:29 +0800 Subject: [PATCH] Revert "Support cast varchar to bitmap (#1941)" (#1960) This reverts commit 88137100cc9fae5a652cb25e8a8a38234c452623. --- be/src/exprs/vectorized/cast_expr.cpp | 29 --------------------------- 1 file changed, 29 deletions(-) diff --git a/be/src/exprs/vectorized/cast_expr.cpp b/be/src/exprs/vectorized/cast_expr.cpp index a1ea5dd9813a1..63d0c494ac12e 100644 --- a/be/src/exprs/vectorized/cast_expr.cpp +++ b/be/src/exprs/vectorized/cast_expr.cpp @@ -15,7 +15,6 @@ #include "gutil/strings/substitute.h" #include "runtime/runtime_state.h" #include "storage/hll.h" -#include "util/bitmap_value.h" #include "util/date_func.h" namespace starrocks { @@ -158,30 +157,6 @@ ColumnPtr cast_fn(ColumnPtr& column) { return builder.build(column->is_constant()); } - -template <> -ColumnPtr cast_fn(ColumnPtr& column) { - ColumnBuilder builder; - ColumnViewer viewer(column); - for (int row = 0; row < viewer.size(); ++row) { - if (viewer.is_null(row)) { - builder.append_null(); - continue; - } - - auto value = viewer.value(row); - BitmapValue bitmap; - // TODO(kks): check value.data is valid bitmap firstly - if (bitmap.deserialize(value.data)) { - builder.append(&bitmap); - } else { - builder.append_null(); - } - } - - return builder.build(column->is_constant()); -} - // all int(tinyint, smallint, int, bigint, largeint) cast implements DEFINE_UNARY_FN_WITH_IMPL(ImplicitToNumber, value) { return value; @@ -1058,10 +1033,6 @@ Expr* VectorizedCastExprFactory::from_thrift(const TExprNode& node) { return new VectorizedCastExpr(node); } - if (from_type == TYPE_VARCHAR && to_type == TYPE_OBJECT) { - return new VectorizedCastExpr(node); - } - if (to_type == TYPE_VARCHAR) { switch (from_type) { CASE_TO_STRING_FROM(TYPE_BOOLEAN);