Skip to content

Commit

Permalink
update“
Browse files Browse the repository at this point in the history
  • Loading branch information
amorynan committed Jan 7, 2025
1 parent 0c85aa9 commit 13ac07e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 14 deletions.
13 changes: 11 additions & 2 deletions be/src/vec/columns/column.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,12 @@ class IColumn : public COW<IColumn> {

/// If possible, returns pointer to memory chunk which contains n-th element (if it isn't possible, throws an exception)
/// Is used to optimize some computations (in aggregation, for example).
virtual StringRef get_data_at(size_t n) const = 0;
/// this function is used in ColumnString, ColumnFixedString, ColumnVector, not support in ColumnArray|ColumnMap...
/// and should be pair with insert_data
virtual StringRef get_data_at(size_t n) const {
throw doris::Exception(ErrorCode::NOT_IMPLEMENTED_ERROR,
"Method get_data_at is not supported for " + get_name());
}

virtual Int64 get_int(size_t /*n*/) const {
throw doris::Exception(ErrorCode::NOT_IMPLEMENTED_ERROR,
Expand Down Expand Up @@ -229,10 +234,14 @@ class IColumn : public COW<IColumn> {
const uint32_t* indices_end) = 0;

/// Appends data located in specified memory chunk if it is possible (throws an exception if it cannot be implemented).
/// used in ColumnString, ColumnFixedString, ColumnVector, not support in ColumnArray|ColumnMap...
/// Is used to optimize some computations (in aggregation, for example).
/// Parameter length could be ignored if column values have fixed size.
/// All data will be inserted as single element
virtual void insert_data(const char* pos, size_t length) = 0;
virtual void insert_data(const char* pos, size_t length) {
throw doris::Exception(ErrorCode::NOT_IMPLEMENTED_ERROR,
"Method insert_data is not supported for " + get_name());
}

virtual void insert_many_fix_len_data(const char* pos, size_t num) {
throw doris::Exception(
Expand Down
10 changes: 0 additions & 10 deletions be/src/vec/columns/column_array.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,16 +152,6 @@ void ColumnArray::get(size_t n, Field& res) const {
for (size_t i = 0; i < size; ++i) get_data().get(offset + i, res_arr[i]);
}

StringRef ColumnArray::get_data_at(size_t n) const {
throw doris::Exception(ErrorCode::NOT_IMPLEMENTED_ERROR,
"Method get_data_at is not supported for " + get_name());
}

void ColumnArray::insert_data(const char* pos, size_t length) {
throw doris::Exception(ErrorCode::NOT_IMPLEMENTED_ERROR,
"Method insert_data is not supported for " + get_name());
}

bool ColumnArray::is_default_at(size_t n) const {
const auto& offsets_data = get_offsets();
return offsets_data[n] == offsets_data[static_cast<ssize_t>(n) - 1];
Expand Down
2 changes: 0 additions & 2 deletions be/src/vec/columns/column_array.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,7 @@ class ColumnArray final : public COWHelper<IColumn, ColumnArray> {
void resize(size_t n) override;
Field operator[](size_t n) const override;
void get(size_t n, Field& res) const override;
StringRef get_data_at(size_t n) const override;
bool is_default_at(size_t n) const;
void insert_data(const char* pos, size_t length) override;
StringRef serialize_value_into_arena(size_t n, Arena& arena, char const*& begin) const override;
const char* deserialize_and_insert_from_arena(const char* pos) override;
void update_hash_with_value(size_t n, SipHash& hash) const override;
Expand Down

0 comments on commit 13ac07e

Please sign in to comment.