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

Method IsSuborderOf

cpp/src/arrow/compute/ordering.cc:53–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51}
52
53bool Ordering::IsSuborderOf(const Ordering& other) const {
54 if (sort_keys_.empty()) {
55 // The implicit ordering is a subordering of nothing. The unordered ordering
56 // is a subordering of everything
57 return !is_implicit_;
58 }
59 if (null_placement_ != other.null_placement_) {
60 return false;
61 }
62 if (sort_keys_.size() > other.sort_keys_.size()) {
63 return false;
64 }
65 for (std::size_t key_idx = 0; key_idx < sort_keys_.size(); key_idx++) {
66 if (!sort_keys_[key_idx].Equals(other.sort_keys_[key_idx])) {
67 return false;
68 }
69 }
70 return true;
71}
72
73bool Ordering::Equals(const Ordering& other) const {
74 return null_placement_ == other.null_placement_ && sort_keys_ == other.sort_keys_;

Callers 1

TESTFunction · 0.80

Calls 3

emptyMethod · 0.45
sizeMethod · 0.45
EqualsMethod · 0.45

Tested by 1

TESTFunction · 0.64