Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangstar333 committed Jan 24, 2025
1 parent bd42fae commit 4912525
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 15 deletions.
2 changes: 1 addition & 1 deletion be/src/vec/columns/column_fixed_length_object.h
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ class ColumnFixedLengthObject final : public COWHelper<IColumn, ColumnFixedLengt

bool has_enough_capacity(const IColumn& src) const override {
const auto& src_col = assert_cast<const ColumnFixedLengthObject&>(src);
return _data.capacity() - _data.size() >= src_col.size();
return _data.capacity() - _data.size() > src_col.size();
}

//NOTICE: here is replace: this[self_row] = rhs[row]
Expand Down
1 change: 0 additions & 1 deletion be/src/vec/columns/column_object.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include <sys/types.h>

#include <algorithm>
#include <cstddef>
#include <memory>
#include <ostream>
#include <string>
Expand Down
17 changes: 4 additions & 13 deletions be/src/vec/columns/column_string.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,10 @@ void ColumnStr<T>::insert_range_from_ignore_overflow(const doris::vectorized::IC
template <typename T>
bool ColumnStr<T>::has_enough_capacity(const IColumn& src) const {
const auto& src_concrete = assert_cast<const ColumnStr<T>&>(src);
const auto& need_char = src_concrete.get_chars().size();
const auto& need_offset = src_concrete.get_offsets().size();
auto left_char_capacity = this->get_chars().capacity() - this->get_chars().size();
auto left_offset_capacity = this->get_offsets().capacity() - this->get_offsets().size();
return (left_char_capacity > need_char) && (left_offset_capacity > need_offset);
return (this->get_chars().capacity() - this->get_chars().size() >
src_concrete.get_chars().size()) &&
(this->get_offsets().capacity() - this->get_offsets().size() >
src_concrete.get_offsets().size());
}

template <typename T>
Expand All @@ -177,10 +176,6 @@ void ColumnStr<T>::insert_range_from(const IColumn& src, size_t start, size_t le

size_t old_chars_size = chars.size();
check_chars_length(old_chars_size + nested_length, offsets.size() + length, size());
if ((old_chars_size + nested_length) > chars.capacity()) {
LOG(INFO) << "asd chars realloc: " << (old_chars_size + nested_length) << " "
<< chars.capacity();
}
chars.resize(old_chars_size + nested_length);
memcpy(&chars[old_chars_size], &src_chars[nested_offset], nested_length);

Expand All @@ -190,10 +185,6 @@ void ColumnStr<T>::insert_range_from(const IColumn& src, size_t start, size_t le
} else {
size_t old_size = offsets.size();
auto prev_max_offset = offsets.back(); /// -1th index is Ok, see PaddedPODArray
if ((old_size + length) > offsets.capacity()) {
LOG(INFO) << "asd offsets realloc: " << (old_size + length) << " "
<< offsets.capacity();
}
offsets.resize(old_size + length);

for (size_t i = 0; i < length; ++i) {
Expand Down
3 changes: 3 additions & 0 deletions be/test/vec/exec/sort/sort_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ class SortTestParam {
default:
break;
}

sorter->init_profile(profile.get());
}

void append_block(ColumnInt32::Ptr column) {
Expand Down Expand Up @@ -114,6 +116,7 @@ class SortTestParam {
VSortExecExprs sort_exec_exprs;
ObjectPool pool;
std::unique_ptr<MockRowDescriptor> row_desc;
std::unique_ptr<RuntimeProfile> profile = std::make_unique<RuntimeProfile>("");

std::vector<bool> is_asc_order {true};
std::vector<bool> nulls_first {false};
Expand Down

0 comments on commit 4912525

Please sign in to comment.