-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
[FIX](complex-type) fix agg table with complex type with replace state #24873
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -140,11 +140,26 @@ class ColumnMap final : public COWHelper<IColumn, ColumnMap> { | |||||
return append_data_by_selector_impl<ColumnMap>(res, selector); | ||||||
} | ||||||
|
||||||
void replace_column_data(const IColumn&, size_t row, size_t self_row = 0) override { | ||||||
LOG(FATAL) << "replace_column_data not implemented"; | ||||||
void replace_column_data(const IColumn& rhs, size_t row, size_t self_row = 0) override { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: method 'replace_column_data' can be made const [readability-make-member-function-const]
Suggested change
|
||||||
DCHECK(size() > self_row); | ||||||
const auto& r = assert_cast<const ColumnMap&>(rhs); | ||||||
const size_t nested_row_size = r.size_at(row); | ||||||
const size_t r_key_nested_start_off = r.offset_at(row); | ||||||
const size_t r_val_nested_start_off = r.offset_at(row); | ||||||
|
||||||
if (self_row == 0) { | ||||||
keys_column->clear(); | ||||||
values_column->clear(); | ||||||
} | ||||||
get_offsets()[self_row] = get_offsets()[self_row - 1] + nested_row_size; | ||||||
// here we use batch size to avoid many virtual call in nested column | ||||||
keys_column->insert_range_from(r.get_keys(), r_key_nested_start_off, nested_row_size); | ||||||
values_column->insert_range_from(r.get_values(), r_val_nested_start_off, nested_row_size); | ||||||
} | ||||||
|
||||||
void replace_column_data_default(size_t self_row = 0) override { | ||||||
LOG(FATAL) << "replace_column_data_default not implemented"; | ||||||
DCHECK(size() > self_row); | ||||||
get_offsets()[self_row] = get_offsets()[self_row - 1]; | ||||||
} | ||||||
|
||||||
ColumnArray::Offsets64& ALWAYS_INLINE get_offsets() { | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -34,6 +34,7 @@ | |||||
#include "common/status.h" | ||||||
#include "vec/columns/column.h" | ||||||
#include "vec/columns/column_impl.h" | ||||||
#include "vec/common/assert_cast.h" | ||||||
#include "vec/common/cow.h" | ||||||
#include "vec/common/sip_hash.h" | ||||||
#include "vec/common/string_ref.h" | ||||||
|
@@ -130,11 +131,20 @@ class ColumnStruct final : public COWHelper<IColumn, ColumnStruct> { | |||||
void append_data_by_selector(MutableColumnPtr& res, const Selector& selector) const override { | ||||||
return append_data_by_selector_impl<ColumnStruct>(res, selector); | ||||||
} | ||||||
void replace_column_data(const IColumn&, size_t row, size_t self_row = 0) override { | ||||||
LOG(FATAL) << "replace_column_data not implemented"; | ||||||
void replace_column_data(const IColumn& rhs, size_t row, size_t self_row = 0) override { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: method 'replace_column_data' can be made const [readability-make-member-function-const]
Suggested change
|
||||||
DCHECK(size() > self_row); | ||||||
const auto& r = assert_cast<const ColumnStruct&>(rhs); | ||||||
|
||||||
for (size_t idx = 0; idx < columns.size(); ++idx) { | ||||||
columns[idx]->replace_column_data(r.get_column(idx), row, self_row); | ||||||
} | ||||||
} | ||||||
|
||||||
void replace_column_data_default(size_t self_row = 0) override { | ||||||
LOG(FATAL) << "replace_column_data_default not implemented"; | ||||||
DCHECK(size() > self_row); | ||||||
for (size_t idx = 0; idx < columns.size(); ++idx) { | ||||||
columns[idx]->replace_column_data_default(self_row); | ||||||
} | ||||||
} | ||||||
|
||||||
void insert_range_from(const IColumn& src, size_t start, size_t length) override; | ||||||
|
This comment was marked as outdated.
Sorry, something went wrong.