Skip to content

Commit

Permalink
[minor](column) remove function "remove_low_cardinality" (#44766)
Browse files Browse the repository at this point in the history
remove function "remove_low_cardinality"
  • Loading branch information
Mryange authored Nov 29, 2024
1 parent b9afb48 commit cb04281
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 26 deletions.
4 changes: 0 additions & 4 deletions be/src/vec/columns/column.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,6 @@ class IColumn : public COW<IColumn> {
*/
virtual Ptr convert_column_if_overflow() { return get_ptr(); }

/// If column isn't ColumnLowCardinality, return itself.
/// If column is ColumnLowCardinality, transforms is to full column.
virtual Ptr convert_to_full_column_if_low_cardinality() const { return get_ptr(); }

/// If column isn't ColumnDictionary, return itself.
/// If column is ColumnDictionary, transforms is to predicate column.
virtual MutablePtr convert_to_predicate_column_if_dictionary() { return get_ptr(); }
Expand Down
4 changes: 0 additions & 4 deletions be/src/vec/columns/column_const.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,6 @@ ColumnPtr ColumnConst::convert_to_full_column() const {
return data->replicate(Offsets(1, cast_set<Offset>(s)));
}

ColumnPtr ColumnConst::remove_low_cardinality() const {
return ColumnConst::create(data->convert_to_full_column_if_low_cardinality(), s);
}

ColumnPtr ColumnConst::filter(const Filter& filt, ssize_t /*result_size_hint*/) const {
column_match_filter_size(s, filt.size());

Expand Down
2 changes: 0 additions & 2 deletions be/src/vec/columns/column_const.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,6 @@ class ColumnConst final : public COWHelper<IColumn, ColumnConst> {

bool is_variable_length() const override { return data->is_variable_length(); }

ColumnPtr remove_low_cardinality() const;

std::string get_name() const override { return "Const(" + data->get_name() + ")"; }

void resize(size_t new_size) override { s = new_size; }
Expand Down
8 changes: 0 additions & 8 deletions be/src/vec/functions/function.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,14 +285,6 @@ DataTypePtr FunctionBuilderImpl::get_return_type_without_low_cardinality(
DataTypePtr FunctionBuilderImpl::get_return_type(const ColumnsWithTypeAndName& arguments) const {
if (use_default_implementation_for_low_cardinality_columns()) {
ColumnsWithTypeAndName args_without_low_cardinality(arguments);

for (ColumnWithTypeAndName& arg : args_without_low_cardinality) {
bool is_const = arg.column && is_column_const(*arg.column);
if (is_const) {
arg.column = assert_cast<const ColumnConst&>(*arg.column).remove_low_cardinality();
}
}

auto type_without_low_cardinality =
get_return_type_without_low_cardinality(args_without_low_cardinality);

Expand Down
8 changes: 0 additions & 8 deletions be/src/vec/functions/nullif.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,6 @@ class FunctionNullIf : public IFunction {

static DataTypePtr get_return_type_for_equal(const ColumnsWithTypeAndName& arguments) {
ColumnsWithTypeAndName args_without_low_cardinality(arguments);

for (ColumnWithTypeAndName& arg : args_without_low_cardinality) {
bool is_const = arg.column && is_column_const(*arg.column);
if (is_const) {
arg.column = assert_cast<const ColumnConst&>(*arg.column).remove_low_cardinality();
}
}

if (!arguments.empty()) {
if (have_null_column(arguments)) {
return make_nullable(std::make_shared<doris::vectorized::DataTypeUInt8>());
Expand Down

0 comments on commit cb04281

Please sign in to comment.