eldenmoon commented on code in PR #66858:
URL: https://github.com/apache/doris/pull/66858#discussion_r3947665883
##########
be/src/storage/segment/variant/binary_column_extract_iterator.cpp:
##########
@@ -117,36 +87,17 @@ Status
BinaryColumnExtractIterator::_fill_variant_v2_path(MutableColumnPtr& dst,
return Status::Corruption("Variant sparse input is not
Map<String,String>");
}
- const auto& offsets = map->get_offsets();
- const StringRef requested {_path.data(), _path.size()};
- DorisVector<StringRef> cells;
- cells.reserve(num_rows);
- DorisVector<uint8_t> missing;
- missing.reserve(num_rows);
- size_t previous_end = 0;
- for (size_t row = 0; row < num_rows; ++row) {
- const size_t end = offsets[ssize_t(row)];
- if (end < previous_end || end > paths->size()) {
- return Status::Corruption("Variant sparse row {} has invalid
offset {}", row, end);
- }
- const size_t lower =
- find_variant_sparse_path_lower_bound(requested, *paths,
previous_end, end);
- if (lower < end && paths->get_data_at(lower) == requested) {
- cells.push_back(values->get_data_at(lower));
- missing.push_back(0);
- } else {
- cells.emplace_back();
- missing.push_back(1);
- }
- previous_end = end;
- }
- if (previous_end != paths->size()) {
- return Status::Corruption("Variant sparse offsets consume {} of {}
cells", previous_end,
- paths->size());
Review Comment:
there is no chance for decreasing intermediate offsets
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]