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

Function CompareArrayRanges

cpp/src/arrow/compare.cc:709–735  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

707};
708
709bool CompareArrayRanges(const ArrayData& left, const ArrayData& right,
710 int64_t left_start_idx, int64_t left_end_idx,
711 int64_t right_start_idx, const EqualOptions& options) {
712 if (left.type->id() != right.type->id() ||
713 !TypeEquals(*left.type, *right.type, false /* check_metadata */)) {
714 return false;
715 }
716
717 const int64_t range_length = left_end_idx - left_start_idx;
718 DCHECK_GE(range_length, 0);
719 if (left_start_idx + range_length > left.length) {
720 // Left range too small
721 return false;
722 }
723 if (right_start_idx + range_length > right.length) {
724 // Right range too small
725 return false;
726 }
727 if (&left == &right && left_start_idx == right_start_idx &&
728 IdentityImpliesEquality(*left.type, options)) {
729 return true;
730 }
731 // Compare values
732 RangeDataEqualsImpl impl(options, left, right, left_start_idx, right_start_idx,
733 range_length);
734 return impl.Compare();
735}
736
737class TypeEqualsVisitor {
738 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