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

[minor](column) remove function "remove_low_cardinality" #44766

Merged
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
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
Loading