Skip to content

Commit 48523c0

Browse files
branch-3.0: [fix](iceberg) fix the iceberg eq-delete filter resize-fill bug. #51253 (#51315)
Cherry-picked from #51253 Co-authored-by: kang <35803862+ghkang98@users.noreply.github.com>
1 parent 873d355 commit 48523c0

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

be/src/vec/common/pod_array.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,8 @@ class PODArray : public PODArrayBase<sizeof(T), initial_bytes, TAllocator, pad_r
392392
this->c_end = this->c_start + this->byte_size(n);
393393
}
394394

395+
/// reset the array capacity
396+
/// fill the new additional elements using the value
395397
void resize_fill(size_t n, const T& value) {
396398
size_t old_size = this->size();
397399
if (n > old_size) {
@@ -617,6 +619,8 @@ class PODArray : public PODArrayBase<sizeof(T), initial_bytes, TAllocator, pad_r
617619
}
618620
}
619621

622+
/// reset the array capacity
623+
/// replace the all elements using the value
620624
void assign(size_t n, const T& x) {
621625
this->resize(n);
622626
std::fill(begin(), end(), x);

be/src/vec/exec/format/table/equality_delete.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ Status SimpleEqualityDelete::filter_data_block(Block* data_block) {
5656
if (_filter == nullptr) {
5757
_filter = std::make_unique<IColumn::Filter>(rows, 0);
5858
} else {
59-
_filter->resize_fill(rows, 0);
59+
// reset the array capacity and fill all elements using the 0
60+
_filter->assign(rows, UInt8(0));
6061
}
6162

6263
if (column_and_type->column->is_nullable()) {
@@ -126,7 +127,8 @@ Status MultiEqualityDelete::filter_data_block(Block* data_block) {
126127
if (_filter == nullptr) {
127128
_filter = std::make_unique<IColumn::Filter>(rows, 1);
128129
} else {
129-
_filter->resize_fill(rows, 1);
130+
//reset the array capacity and fill all elements using the 0
131+
_filter->assign(rows, UInt8(1));
130132
}
131133
auto* filter_data = _filter->data();
132134
for (size_t i = 0; i < rows; ++i) {

0 commit comments

Comments
 (0)