diff --git a/be/src/storage/column_in_predicate.cpp b/be/src/storage/column_in_predicate.cpp index 3e673132e2af4..addcd06ecc1a2 100644 --- a/be/src/storage/column_in_predicate.cpp +++ b/be/src/storage/column_in_predicate.cpp @@ -334,89 +334,6 @@ class BinaryColumnInPredicate : public ColumnPredicate { ItemHashSet _slices; }; -<<<<<<< HEAD -======= -class DictionaryCodeInPredicate : public ColumnPredicate { -private: - enum LogicOp { ASSIGN, AND, OR }; - -public: - DictionaryCodeInPredicate(const TypeInfoPtr& type_info, ColumnId id, const std::vector& operands, - size_t size) - : ColumnPredicate(type_info, id), _bit_mask(size) { - for (auto item : operands) { - DCHECK(item < size); - _bit_mask[item] = 1; - } - } - - ~DictionaryCodeInPredicate() override = default; - - template - inline void t_evaluate(const Column* column, uint8_t* sel, uint16_t from, uint16_t to) const { - const Int32Column* dict_code_column = down_cast(ColumnHelper::get_data_column(column)); - const auto& data = dict_code_column->get_data(); - Filter filter(to - from, 1); - - if (column->has_null()) { - const NullColumn* null_column = down_cast(column)->null_column().get(); - const auto& null_data = null_column->get_data(); - for (auto i = from; i < to; i++) { - auto index = data[i] >= _bit_mask.size() ? 0 : data[i]; - filter[i - from] = (!null_data[i]) & _bit_mask[index]; - } - } else { - for (auto i = from; i < to; i++) { - filter[i - from] = _bit_mask[data[i]]; - } - } - - for (auto i = from; i < to; i++) { - if constexpr (Op == ASSIGN) { - sel[i] = filter[i - from]; - } else if constexpr (Op == AND) { - sel[i] &= filter[i - from]; - } else { - sel[i] |= filter[i - from]; - } - } - } - - Status evaluate(const Column* column, uint8_t* selection, uint16_t from, uint16_t to) const override { - t_evaluate(column, selection, from, to); - return Status::OK(); - } - - Status evaluate_and(const Column* column, uint8_t* selection, uint16_t from, uint16_t to) const override { - t_evaluate(column, selection, from, to); - return Status::OK(); - } - - Status evaluate_or(const Column* column, uint8_t* selection, uint16_t from, uint16_t to) const override { - t_evaluate(column, selection, from, to); - return Status::OK(); - } - - bool can_vectorized() const override { return false; } - - PredicateType type() const override { return PredicateType::kInList; } - - Status convert_to(const ColumnPredicate** output, const TypeInfoPtr& target_type_info, - ObjectPool* obj_pool) const override { - const auto to_type = target_type_info->type(); - if (to_type == LogicalType::TYPE_INT) { - *output = this; - return Status::OK(); - } - CHECK(false) << "Not support, from_type=" << LogicalType::TYPE_INT << ", to_type=" << to_type; - return Status::OK(); - } - -private: - std::vector _bit_mask; -}; - ->>>>>>> 9aeb07ce0d ([BugFix] Fix Unexpected memory copy (#53052)) template