Add countSerializeByteSize/serializeToPos/deserializeAndInsertFromPos interface to IColumn#9553
Conversation
Signed-off-by: gengliqi <gengliqiii@gmail.com>
| { | ||
| return i == 0 ? getOffsets()[0] : (getOffsets()[i] - getOffsets()[i - 1]); | ||
| } | ||
| size_t ALWAYS_INLINE sizeAt(ssize_t i) const { return (getOffsets()[i] - getOffsets()[i - 1]); } |
There was a problem hiding this comment.
Does we ensure getOffsets()[-1] == 0 is well-defined?
There was a problem hiding this comment.
|
/retest |
Signed-off-by: gengliqi <gengliqiii@gmail.com>
d374eba to
76bc654
Compare
Signed-off-by: gengliqi <gengliqiii@gmail.com>
fa676b5 to
4fa37a0
Compare
Signed-off-by: gengliqi <gengliqiii@gmail.com>
f5c6c20 to
4917dd7
Compare
dbms/src/Columns/ColumnDecimal.cpp
Outdated
| tmp_val.resize(limb_count, limb_count); | ||
| inline_memcpy(tmp_val.limbs(), val.limbs(), limb_count * sizeof(boost::multiprecision::limb_type)); | ||
| if (val.sign() != tmp_val.sign()) | ||
| tmp_val.negate(); |
There was a problem hiding this comment.
maybe use the builtin assign function like tmp_val.assign(val)?
| data.resize(prev_size + (size - i) / avx2_width * avx2_width, FULL_VECTOR_SIZE_AVX2); | ||
| for (; i + avx2_width <= size; i += avx2_width) | ||
| { | ||
| /// Loop unrolling |
There was a problem hiding this comment.
You mean this is a todo item or the compiler will do the loop unrolling?
There was a problem hiding this comment.
The compiler will probably do the loop unrolling (if av2_width is not too large) because avx2_width is a constexpr and there is no dependency between each loop.
| static constexpr size_t pad_right = integerRoundUp(pad_right_, ELEMENT_SIZE); | ||
| /// pad_left is also rounded up to 16 bytes to maintain alignment of allocated memory. | ||
| static constexpr size_t pad_left = integerRoundUp(integerRoundUp(pad_left_, ELEMENT_SIZE), 16); | ||
| /// pad_left is also rounded up to 64 bytes to maintain alignment of allocated memory. |
There was a problem hiding this comment.
why need to change this?
There was a problem hiding this comment.
If not, the data will not be aligned to 64 bytes when calling resize(n, 64).
Signed-off-by: gengliqi <gengliqiii@gmail.com>
|
/hold |
|
/unhold |
Signed-off-by: gengliqi <gengliqiii@gmail.com>
dbms/src/Columns/ColumnString.cpp
Outdated
| size_t sz = size(); | ||
| for (size_t i = 0; i < sz; ++i) | ||
| RUNTIME_CHECK_MSG( | ||
| sizeAt(i) > UINT32_MAX, |
There was a problem hiding this comment.
Looks like you want to find the first string whose length is greater than UINT32_MAX?
But if sizeAt(i) > UINT32_MAX is true, for loop will iter to next value.
There was a problem hiding this comment.
Good catch! Fixed.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: guo-shaoge, windtalker The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
|
/hold |
Signed-off-by: gengliqi <gengliqiii@gmail.com>
|
/unhold |
What problem does this PR solve?
Issue Number: ref #9060
Problem Summary:
What is changed and how it works?
Some code from #9191.
Check List
Tests
Side effects
Documentation
Release note