MCPcopy Create free account
hub / github.com/apache/arrow / CompareWithOffsets

Method CompareWithOffsets

cpp/src/arrow/compare.cc:644–665  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

642
643 template <typename offset_type, typename CompareRanges>
644 void CompareWithOffsets(int offsets_buffer_index, CompareRanges&& compare_ranges) {
645 const offset_type* left_offsets =
646 left_.GetValues<offset_type>(offsets_buffer_index) + left_start_idx_;
647 const offset_type* right_offsets =
648 right_.GetValues<offset_type>(offsets_buffer_index) + right_start_idx_;
649
650 const auto compare_runs = [&](int64_t i, int64_t length) {
651 for (int64_t j = i; j < i + length; ++j) {
652 if (left_offsets[j + 1] - left_offsets[j] !=
653 right_offsets[j + 1] - right_offsets[j]) {
654 return false;
655 }
656 }
657 if (!compare_ranges(left_offsets[i], right_offsets[i],
658 left_offsets[i + length] - left_offsets[i])) {
659 return false;
660 }
661 return true;
662 };
663
664 VisitValidRuns(compare_runs);
665 }
666
667 template <typename CompareValues>
668 void VisitValues(CompareValues&& compare_values) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected