Skip to content

Commit

Permalink
[Enchancement](column) make create_always_true_column return column c…
Browse files Browse the repository at this point in the history
…onst (#39086)

## Proposed changes
make create_always_true_column return column const
  • Loading branch information
BiteTheDDDDt authored Sep 10, 2024
1 parent 4949a9e commit 1d0690b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions be/src/vec/utils/util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,12 @@ inline std::string remove_suffix(const std::string& name, const std::string& suf
};

inline ColumnPtr create_always_true_column(size_t size, bool is_nullable) {
auto res_data_column = ColumnUInt8::create(size, 1);
ColumnPtr res_data_column = ColumnUInt8::create(1, 1);
if (is_nullable) {
auto null_map = ColumnVector<UInt8>::create(size, 0);
return ColumnNullable::create(std::move(res_data_column), std::move(null_map));
auto null_map = ColumnVector<UInt8>::create(1, 0);
res_data_column = ColumnNullable::create(res_data_column, std::move(null_map));
}
return res_data_column;
return ColumnConst::create(std::move(res_data_column), size);
}

// change null element to true element
Expand Down

0 comments on commit 1d0690b

Please sign in to comment.