This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new 59e3a79b55c [Opt](exec) opt the repeat node code (#30683)
59e3a79b55c is described below
commit 59e3a79b55c1f1dcf535e618b1f619ed1daee813
Author: HappenLee <[email protected]>
AuthorDate: Thu Feb 1 21:16:44 2024 +0800
[Opt](exec) opt the repeat node code (#30683)
---
be/src/pipeline/exec/repeat_operator.cpp | 5 ++---
be/src/vec/columns/column_vector.h | 21 ---------------------
be/src/vec/exec/vrepeat_node.cpp | 5 ++---
3 files changed, 4 insertions(+), 27 deletions(-)
diff --git a/be/src/pipeline/exec/repeat_operator.cpp
b/be/src/pipeline/exec/repeat_operator.cpp
index d1613a6125f..d1f3dc7ccd0 100644
--- a/be/src/pipeline/exec/repeat_operator.cpp
+++ b/be/src/pipeline/exec/repeat_operator.cpp
@@ -158,6 +158,7 @@ Status
RepeatLocalState::get_repeated_block(vectorized::Block* child_block, int
cur_col++;
}
+ const auto rows = child_block->rows();
// Fill grouping ID to block
for (auto slot_idx = 0; slot_idx < p._grouping_list.size(); slot_idx++) {
DCHECK_LT(slot_idx, p._output_tuple_desc->slots().size());
@@ -169,9 +170,7 @@ Status
RepeatLocalState::get_repeated_block(vectorized::Block* child_block, int
DCHECK(!p._output_slots[cur_col]->is_nullable());
auto* col =
assert_cast<vectorized::ColumnVector<vectorized::Int64>*>(column_ptr);
- for (size_t i = 0; i < child_block->rows(); ++i) {
- col->insert_value(val);
- }
+ col->insert_raw_integers(val, rows);
cur_col++;
}
diff --git a/be/src/vec/columns/column_vector.h
b/be/src/vec/columns/column_vector.h
index c75d7db6054..acc8688786f 100644
--- a/be/src/vec/columns/column_vector.h
+++ b/be/src/vec/columns/column_vector.h
@@ -173,16 +173,6 @@ private:
/// Sugar constructor.
ColumnVector(std::initializer_list<T> il) : data {il} {}
- void insert_res_column(const uint16_t* sel, size_t sel_size,
- vectorized::ColumnVector<T>* res_ptr) {
- auto& res_data = res_ptr->data;
- DCHECK(res_data.empty());
- res_data.resize(sel_size);
- for (size_t i = 0; i < sel_size; i++) {
- res_data[i] = T(data[sel[i]]);
- }
- }
-
void insert_many_default_type(const char* data_ptr, size_t num) {
auto old_size = data.size();
data.resize(old_size + num);
@@ -429,20 +419,11 @@ public:
}
}
- void insert_zeroed_elements(size_t num) {
- auto old_size = data.size();
- auto new_size = old_size + num;
- data.resize(new_size);
- memset(&data[old_size], 0, sizeof(value_type) * num);
- }
-
ColumnPtr filter(const IColumn::Filter& filt, ssize_t result_size_hint)
const override;
size_t filter(const IColumn::Filter& filter) override;
ColumnPtr permute(const IColumn::Permutation& perm, size_t limit) const
override;
- // ColumnPtr index(const IColumn & indexes, size_t limit) const
override;
-
template <typename Type>
ColumnPtr index_impl(const PaddedPODArray<Type>& indexes, size_t limit)
const;
@@ -464,8 +445,6 @@ public:
this->template append_data_by_selector_impl<Self>(res, selector);
}
- // void gather(ColumnGathererStream & gatherer_stream) override;
-
bool is_fixed_and_contiguous() const override { return true; }
size_t size_of_value_if_fixed() const override { return sizeof(T); }
StringRef get_raw_data() const override {
diff --git a/be/src/vec/exec/vrepeat_node.cpp b/be/src/vec/exec/vrepeat_node.cpp
index 717c0c28d08..921473a8fed 100644
--- a/be/src/vec/exec/vrepeat_node.cpp
+++ b/be/src/vec/exec/vrepeat_node.cpp
@@ -151,6 +151,7 @@ Status VRepeatNode::get_repeated_block(Block* child_block,
int repeat_id_idx, Bl
cur_col++;
}
+ const auto rows = child_block->rows();
// Fill grouping ID to block
for (auto slot_idx = 0; slot_idx < _grouping_list.size(); slot_idx++) {
DCHECK_LT(slot_idx, _output_tuple_desc->slots().size());
@@ -162,9 +163,7 @@ Status VRepeatNode::get_repeated_block(Block* child_block,
int repeat_id_idx, Bl
DCHECK(!_output_slots[cur_col]->is_nullable());
auto* col = assert_cast<ColumnVector<Int64>*>(column_ptr);
- for (size_t i = 0; i < child_block->rows(); ++i) {
- col->insert_value(val);
- }
+ col->insert_raw_integers(val, rows);
cur_col++;
}
output_block->set_columns(std::move(columns));
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]