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

Method CompareListView

cpp/src/arrow/compare.cc:587–616  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

585
586 template <typename TypeClass>
587 Status CompareListView(const TypeClass& type) {
588 const ArrayData& left_values = *left_.child_data[0];
589 const ArrayData& right_values = *right_.child_data[0];
590
591 using offset_type = typename TypeClass::offset_type;
592 const auto* left_offsets = left_.GetValues<offset_type>(1) + left_start_idx_;
593 const auto* right_offsets = right_.GetValues<offset_type>(1) + right_start_idx_;
594 const auto* left_sizes = left_.GetValues<offset_type>(2) + left_start_idx_;
595 const auto* right_sizes = right_.GetValues<offset_type>(2) + right_start_idx_;
596
597 auto compare_view = [&](int64_t i, int64_t length) -> bool {
598 for (int64_t j = i; j < i + length; ++j) {
599 if (left_sizes[j] != right_sizes[j]) {
600 return false;
601 }
602 const offset_type size = left_sizes[j];
603 if (size == 0) {
604 continue;
605 }
606 RangeDataEqualsImpl impl(options_, left_values, right_values, left_offsets[j],
607 right_offsets[j], size);
608 if (!impl.Compare()) {
609 return false;
610 }
611 }
612 return true;
613 };
614 VisitValidRuns(std::move(compare_view));
615 return Status::OK();
616 }
617
618 template <typename RunEndCType>
619 Status CompareRunEndEncoded() {

Callers

nothing calls this directly

Calls 2

OKFunction · 0.70
CompareMethod · 0.45

Tested by

no test coverage detected