Skip to content

Commit

Permalink
Revert "Support cast varchar to bitmap (#1941)" (#1960)
Browse files Browse the repository at this point in the history
This reverts commit 8813710.
  • Loading branch information
kangkaisen authored Dec 8, 2021
1 parent 9e9b0c1 commit da84cf9
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions be/src/exprs/vectorized/cast_expr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -158,30 +157,6 @@ ColumnPtr cast_fn<TYPE_VARCHAR, TYPE_HLL>(ColumnPtr& column) {

return builder.build(column->is_constant());
}

template <>
ColumnPtr cast_fn<TYPE_VARCHAR, TYPE_OBJECT>(ColumnPtr& column) {
ColumnBuilder<TYPE_OBJECT> builder;
ColumnViewer<TYPE_VARCHAR> 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;
Expand Down Expand Up @@ -1058,10 +1033,6 @@ Expr* VectorizedCastExprFactory::from_thrift(const TExprNode& node) {
return new VectorizedCastExpr<TYPE_VARCHAR, TYPE_HLL>(node);
}

if (from_type == TYPE_VARCHAR && to_type == TYPE_OBJECT) {
return new VectorizedCastExpr<TYPE_VARCHAR, TYPE_OBJECT>(node);
}

if (to_type == TYPE_VARCHAR) {
switch (from_type) {
CASE_TO_STRING_FROM(TYPE_BOOLEAN);
Expand Down

0 comments on commit da84cf9

Please sign in to comment.