Apache Arrow (C++)
A columnar in-memory analytics layer designed to accelerate big data.
compare.h
Go to the documentation of this file.
1 // Licensed to the Apache Software Foundation (ASF) under one
2 // or more contributor license agreements. See the NOTICE file
3 // distributed with this work for additional information
4 // regarding copyright ownership. The ASF licenses this file
5 // to you under the Apache License, Version 2.0 (the
6 // "License"); you may not use this file except in compliance
7 // with the License. You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing,
12 // software distributed under the License is distributed on an
13 // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 // KIND, either express or implied. See the License for the
15 // specific language governing permissions and limitations
16 // under the License.
17 
18 // Functions for comparing Arrow data structures
19 
20 #ifndef ARROW_COMPARE_H
21 #define ARROW_COMPARE_H
22 
23 #include <cstdint>
24 
25 #include "arrow/util/visibility.h"
26 
27 namespace arrow {
28 
29 class Array;
30 class DataType;
31 class Status;
32 class Tensor;
33 
34 #ifndef ARROW_NO_DEPRECATED_API
35 Status ARROW_EXPORT ArrayEquals(const Array& left, const Array& right, bool* are_equal);
38 
40 Status ARROW_EXPORT TensorEquals(const Tensor& left, const Tensor& right,
41  bool* are_equal);
42 
46 Status ARROW_EXPORT ArrayApproxEquals(const Array& left, const Array& right,
47  bool* are_equal);
48 
51 Status ARROW_EXPORT ArrayRangeEquals(const Array& left, const Array& right,
52  int64_t start_idx, int64_t end_idx,
53  int64_t other_start_idx, bool* are_equal);
54 
57 Status ARROW_EXPORT TypeEquals(const DataType& left, const DataType& right,
58  bool* are_equal);
59 #endif
60 
62 bool ARROW_EXPORT ArrayEquals(const Array& left, const Array& right);
63 
64 bool ARROW_EXPORT TensorEquals(const Tensor& left, const Tensor& right);
65 
68 bool ARROW_EXPORT ArrayApproxEquals(const Array& left, const Array& right);
69 
71 bool ARROW_EXPORT ArrayRangeEquals(const Array& left, const Array& right,
72  int64_t start_idx, int64_t end_idx,
73  int64_t other_start_idx);
74 
76 bool ARROW_EXPORT TypeEquals(const DataType& left, const DataType& right);
77 
78 } // namespace arrow
79 
80 #endif // ARROW_COMPARE_H
Status TypeEquals(const DataType &left, const DataType &right, bool *are_equal)
Returns true if the type metadata are exactly equal.
Status ArrayApproxEquals(const Array &left, const Array &right, bool *are_equal)
Returns true if the arrays are approximately equal.
Status ArrayEquals(const Array &left, const Array &right, bool *are_equal)
Returns true if the arrays are exactly equal.
Top-level namespace for Apache Arrow C++ API.
Definition: allocator.h:29
Status ArrayRangeEquals(const Array &left, const Array &right, int64_t start_idx, int64_t end_idx, int64_t other_start_idx, bool *are_equal)
Returns true if indicated equal-length segment of arrays is exactly equal.
Status TensorEquals(const Tensor &left, const Tensor &right, bool *are_equal)