| 119 | } // namespace |
| 120 | |
| 121 | bool ChunkedArray::Equals(const ChunkedArray& other, const EqualOptions& opts) const { |
| 122 | if (this == &other) { |
| 123 | if (opts.nans_equal()) { |
| 124 | return true; |
| 125 | } else if (!ContainsFloatType(*type_)) { |
| 126 | return true; |
| 127 | } |
| 128 | } |
| 129 | if (length_ != other.length()) { |
| 130 | return false; |
| 131 | } |
| 132 | if (null_count_ != other.null_count()) { |
| 133 | return false; |
| 134 | } |
| 135 | // We cannot toggle check_metadata here yet, so we don't check it |
| 136 | if (!type_->Equals(*other.type_, /*check_metadata=*/false)) { |
| 137 | return false; |
| 138 | } |
| 139 | |
| 140 | // Check contents of the underlying arrays. This checks for equality of |
| 141 | // the underlying data independently of the chunk size. |
| 142 | return internal::ApplyBinaryChunked( |
| 143 | *this, other, |
| 144 | [&](const Array& left_piece, const Array& right_piece, |
| 145 | int64_t ARROW_ARG_UNUSED(position)) { |
| 146 | if (!left_piece.Equals(right_piece, opts)) { |
| 147 | return Status::Invalid("Unequal piece"); |
| 148 | } |
| 149 | return Status::OK(); |
| 150 | }) |
| 151 | .ok(); |
| 152 | } |
| 153 | |
| 154 | bool ChunkedArray::Equals(const std::shared_ptr<ChunkedArray>& other, |
| 155 | const EqualOptions& opts) const { |
no test coverage detected