iceberg-cpp
Loading...
Searching...
No Matches
arrow_array_wrapper.h
Go to the documentation of this file.
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19
20#pragma once
21
25
28
29namespace iceberg {
30
32class ICEBERG_EXPORT ArrowArrayStructLike : public StructLike {
33 public:
34 ~ArrowArrayStructLike() override;
35
36 Result<Scalar> GetField(size_t pos) const override;
37
38 size_t num_fields() const override;
39
40 Status Reset(int64_t row_index);
41
42 Status Reset(const ArrowArray& array, int64_t row_index = 0);
43
44 static Result<std::unique_ptr<ArrowArrayStructLike>> Make(const ArrowSchema& schema,
45 const ArrowArray& array,
46 int64_t row_index = 0);
47
49 ArrowArrayStructLike& operator=(const ArrowArrayStructLike&) = delete;
50
51 private:
52 class Impl;
53 explicit ArrowArrayStructLike(std::unique_ptr<Impl> impl);
54
55 std::unique_ptr<Impl> impl_;
56};
57
59class ICEBERG_EXPORT ArrowArrayArrayLike : public ArrayLike {
60 public:
61 ~ArrowArrayArrayLike() override;
62
63 Result<Scalar> GetElement(size_t pos) const override;
64
65 size_t size() const override;
66
67 Status Reset(int64_t row_index);
68
69 Status Reset(const ArrowArray& array, int64_t row_index = 0);
70
71 static Result<std::unique_ptr<ArrowArrayArrayLike>> Make(const ArrowSchema& schema,
72 const ArrowArray& array,
73 int64_t row_index = 0);
74
75 ArrowArrayArrayLike(const ArrowArrayArrayLike& other) = delete;
76 ArrowArrayArrayLike& operator=(const ArrowArrayArrayLike& other) = delete;
77
78 private:
79 class Impl;
80 explicit ArrowArrayArrayLike(std::unique_ptr<Impl> impl);
81
82 std::unique_ptr<Impl> impl_;
83};
84
86class ICEBERG_EXPORT ArrowArrayMapLike : public MapLike {
87 public:
88 ~ArrowArrayMapLike() override;
89
90 Result<Scalar> GetKey(size_t pos) const override;
91
92 Result<Scalar> GetValue(size_t pos) const override;
93
94 size_t size() const override;
95
96 Status Reset(int64_t row_index);
97
98 Status Reset(const ArrowArray& array, int64_t row_index = 0);
99
100 static Result<std::unique_ptr<ArrowArrayMapLike>> Make(const ArrowSchema& schema,
101 const ArrowArray& array,
102 int64_t row_index = 0);
103
104 ArrowArrayMapLike(const ArrowArrayMapLike& other) = delete;
105 ArrowArrayMapLike& operator=(const ArrowArrayMapLike& other) = delete;
106
107 private:
108 class Impl;
109 explicit ArrowArrayMapLike(std::unique_ptr<Impl> impl);
110
111 std::unique_ptr<Impl> impl_;
112};
113
114} // namespace iceberg
An immutable array-like wrapper.
Definition struct_like.h:75
Definition arrow_array_wrapper.cc:199
Wrapper for one row of a list-typed ArrowArray.
Definition arrow_array_wrapper.h:59
Definition arrow_array_wrapper.cc:295
Wrapper for one row of a map-typed ArrowArray.
Definition arrow_array_wrapper.h:86
Definition arrow_array_wrapper.cc:112
Wrapper for one row of a struct-typed ArrowArray.
Definition arrow_array_wrapper.h:32
An immutable map-like wrapper.
Definition struct_like.h:88
An immutable struct-like wrapper.
Definition struct_like.h:62
Definition arrow_c_data.h:57
Definition arrow_c_data.h:41