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

Function CompareArrayRanges

cpp/src/arrow/compare.cc:683–710  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

681};
682
683bool CompareArrayRanges(const ArrayData& left, const ArrayData& right,
684 int64_t left_start_idx, int64_t left_end_idx,
685 int64_t right_start_idx, const EqualOptions& options,
686 bool floating_approximate) {
687 if (left.type->id() != right.type->id() ||
688 !TypeEquals(*left.type, *right.type, false /* check_metadata */)) {
689 return false;
690 }
691
692 const int64_t range_length = left_end_idx - left_start_idx;
693 DCHECK_GE(range_length, 0);
694 if (left_start_idx + range_length > left.length) {
695 // Left range too small
696 return false;
697 }
698 if (right_start_idx + range_length > right.length) {
699 // Right range too small
700 return false;
701 }
702 if (&left == &right && left_start_idx == right_start_idx &&
703 IdentityImpliesEquality(*left.type, options)) {
704 return true;
705 }
706 // Compare values
707 RangeDataEqualsImpl impl(options, floating_approximate, left, right, left_start_idx,
708 right_start_idx, range_length);
709 return impl.Compare();
710}
711
712class TypeEqualsVisitor {
713 public:

Callers 2

VisitMethod · 0.85
ArrayRangeEqualsFunction · 0.85

Calls 4

TypeEqualsFunction · 0.85
IdentityImpliesEqualityFunction · 0.85
idMethod · 0.45
CompareMethod · 0.45

Tested by

no test coverage detected