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

[Refactor](vec) Remove the unless api in IColumn #44619

Merged
merged 1 commit into from
Nov 29, 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
12 changes: 1 addition & 11 deletions be/src/vec/columns/column.h
Original file line number Diff line number Diff line change
Expand Up @@ -569,10 +569,6 @@ class IColumn : public COW<IColumn> {
/// It's true for ColumnNullable, can be true or false for ColumnConst, etc.
virtual bool is_concrete_nullable() const { return false; }

virtual bool is_bitmap() const { return false; }

virtual bool is_hll() const { return false; }

// true if column has null element
virtual bool has_null() const { return false; }

Expand Down Expand Up @@ -611,19 +607,13 @@ class IColumn : public COW<IColumn> {
/// Checks only @sample_ratio ratio of rows.
virtual double get_ratio_of_default_rows(double sample_ratio = 1.0) const { return 0.0; }

/// Column is ColumnVector of numbers or ColumnConst of it. Note that Nullable columns are not numeric.
/// Implies is_fixed_and_contiguous.
virtual bool is_numeric() const { return false; }

// Column is ColumnString/ColumnArray/ColumnMap or other variable length column at every row
virtual bool is_variable_length() const { return false; }

virtual bool is_column_string() const { return false; }

virtual bool is_column_string64() const { return false; }

virtual bool is_column_decimal() const { return false; }

virtual bool is_column_dictionary() const { return false; }

virtual bool is_column_array() const { return false; }
Expand Down Expand Up @@ -756,4 +746,4 @@ struct ColumnPtrWrapper {

ColumnPtrWrapper(vectorized::ColumnPtr col) : column_ptr(std::move(col)) {}
};
} // namespace doris
} // namespace doris
5 changes: 0 additions & 5 deletions be/src/vec/columns/column_complex.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,6 @@ class ColumnComplexType final : public COWHelper<IColumn, ColumnComplexType<T>>
using value_type = T;
using Container = std::vector<value_type>;

bool is_numeric() const override { return false; }

bool is_bitmap() const override { return std::is_same_v<T, BitmapValue>; }
bool is_hll() const override { return std::is_same_v<T, HyperLogLog>; }

size_t size() const override { return data.size(); }

StringRef get_data_at(size_t n) const override {
Expand Down
1 change: 0 additions & 1 deletion be/src/vec/columns/column_const.h
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,6 @@ class ColumnConst final : public COWHelper<IColumn, ColumnConst> {
// ColumnConst is not nullable, but may be concrete nullable.
bool is_concrete_nullable() const override { return is_column_nullable(*data); }
bool only_null() const override { return data->is_null_at(0); }
bool is_numeric() const override { return data->is_numeric(); }
StringRef get_raw_data() const override { return data->get_raw_data(); }

/// Not part of the common interface.
Expand Down
3 changes: 0 additions & 3 deletions be/src/vec/columns/column_decimal.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,6 @@ class ColumnDecimal final : public COWHelper<IColumn, ColumnDecimal<T>> {
public:
std::string get_name() const override { return TypeName<T>::get(); }

bool is_numeric() const override { return false; }
bool is_column_decimal() const override { return true; }

size_t size() const override { return data.size(); }
size_t byte_size() const override { return data.size() * sizeof(data[0]); }
size_t allocated_bytes() const override { return data.allocated_bytes(); }
Expand Down
3 changes: 0 additions & 3 deletions be/src/vec/columns/column_nullable.h
Original file line number Diff line number Diff line change
Expand Up @@ -327,9 +327,6 @@ class ColumnNullable final : public COWHelper<IColumn, ColumnNullable>, public N

bool is_nullable() const override { return true; }
bool is_concrete_nullable() const override { return true; }
HappenLee marked this conversation as resolved.
Show resolved Hide resolved
bool is_bitmap() const override { return get_nested_column().is_bitmap(); }
bool is_hll() const override { return get_nested_column().is_hll(); }
bool is_column_decimal() const override { return get_nested_column().is_column_decimal(); }
bool is_column_string() const override { return get_nested_column().is_column_string(); }
bool is_column_array() const override { return get_nested_column().is_column_array(); }
bool is_column_map() const override { return get_nested_column().is_column_map(); }
Expand Down
2 changes: 0 additions & 2 deletions be/src/vec/columns/column_vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,6 @@ class ColumnVector final : public COWHelper<IColumn, ColumnVector<T>> {
ColumnVector(std::initializer_list<T> il) : data {il} {}

public:
bool is_numeric() const override { return IsNumber<T>; }

size_t size() const override { return data.size(); }

StringRef get_data_at(size_t n) const override {
Expand Down
2 changes: 0 additions & 2 deletions be/src/vec/columns/predicate_column.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,6 @@ class PredicateColumnType final : public COWHelper<IColumn, PredicateColumnType<
using value_type = T;
using Container = PaddedPODArray<value_type>;

bool is_numeric() const override { return false; }

size_t size() const override { return data.size(); }

StringRef get_data_at(size_t n) const override {
Expand Down
1 change: 1 addition & 0 deletions be/src/vec/data_types/data_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ struct WhichDataType {
bool is_aggregate_function() const { return idx == TypeIndex::AggregateFunction; }
bool is_variant_type() const { return idx == TypeIndex::VARIANT; }
bool is_simple() const { return is_int() || is_uint() || is_float() || is_string(); }
bool is_num_can_compare() const { return is_int_or_uint() || is_float() || is_ip(); }
};

/// IDataType helpers (alternative for IDataType virtual methods with single point of truth)
Expand Down
6 changes: 3 additions & 3 deletions be/src/vec/functions/functions_comparison.h
Original file line number Diff line number Diff line change
Expand Up @@ -637,8 +637,8 @@ class FunctionComparison : public IFunction {
WhichDataType which_left {left_type};
WhichDataType which_right {right_type};

const bool left_is_num = col_left_untyped->is_numeric();
const bool right_is_num = col_right_untyped->is_numeric();
const bool left_is_num_can_compare = which_left.is_num_can_compare();
const bool right_is_num_can_compare = which_right.is_num_can_compare();

const bool left_is_string = which_left.is_string_or_fixed_string();
const bool right_is_string = which_right.is_string_or_fixed_string();
Expand All @@ -648,7 +648,7 @@ class FunctionComparison : public IFunction {
// bool date_and_datetime = (left_type != right_type) && which_left.is_date_or_datetime() &&
// which_right.is_date_or_datetime();

if (left_is_num && right_is_num) {
if (left_is_num_can_compare && right_is_num_can_compare) {
if (!(execute_num_left_type<UInt8>(block, result, col_left_untyped,
col_right_untyped) ||
execute_num_left_type<UInt16>(block, result, col_left_untyped,
Expand Down
Loading