Project
Loading...
Searching...
No Matches
ArrowTypes.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
12#ifndef O2_FRAMEWORK_ARROWTYPES_H
13#define O2_FRAMEWORK_ARROWTYPES_H
14#include "arrow/type_fwd.h"
15#include <span>
16
17namespace o2::soa
18{
19template <typename T>
21};
22template <>
23struct arrow_array_for<bool> {
24 using type = arrow::BooleanArray;
25};
26template <>
27struct arrow_array_for<int8_t> {
28 using type = arrow::Int8Array;
29};
30template <>
31struct arrow_array_for<uint8_t> {
32 using type = arrow::UInt8Array;
33};
34template <>
35struct arrow_array_for<int16_t> {
36 using type = arrow::Int16Array;
37};
38template <>
39struct arrow_array_for<uint16_t> {
40 using type = arrow::UInt16Array;
41};
42template <>
43struct arrow_array_for<int32_t> {
44 using type = arrow::Int32Array;
45};
46template <>
47struct arrow_array_for<int64_t> {
48 using type = arrow::Int64Array;
49};
50template <>
51struct arrow_array_for<uint32_t> {
52 using type = arrow::UInt32Array;
53};
54template <>
55struct arrow_array_for<uint64_t> {
56 using type = arrow::UInt64Array;
57};
58template <>
59struct arrow_array_for<float> {
60 using type = arrow::FloatArray;
61};
62template <>
63struct arrow_array_for<double> {
64 using type = arrow::DoubleArray;
65};
66template <>
67struct arrow_array_for<std::span<std::byte>> {
68 using type = arrow::BinaryViewArray;
69};
70template <int N>
71struct arrow_array_for<float[N]> {
72 using type = arrow::FixedSizeListArray;
73 using value_type = float;
74};
75template <int N>
76struct arrow_array_for<int[N]> {
77 using type = arrow::FixedSizeListArray;
78 using value_type = int;
79};
80template <int N>
82 using type = arrow::FixedSizeListArray;
84};
85template <int N>
86struct arrow_array_for<double[N]> {
87 using type = arrow::FixedSizeListArray;
88 using value_type = double;
89};
90template <int N>
91struct arrow_array_for<int8_t[N]> {
92 using type = arrow::FixedSizeListArray;
93 using value_type = int8_t;
94};
95
96#define ARROW_VECTOR_FOR(_type_) \
97 template <> \
98 struct arrow_array_for<std::vector<_type_>> { \
99 using type = arrow::ListArray; \
100 using value_type = _type_; \
101 };
102
107
112
115
116template <typename T>
118template <typename T>
120} // namespace o2::soa
121#endif // O2_FRAMEWORK_ARROWTYPES_H
#define ARROW_VECTOR_FOR(_type_)
Definition ArrowTypes.h:96
typename arrow_array_for< T >::value_type value_for_t
Definition ArrowTypes.h:119
typename arrow_array_for< T >::type arrow_array_for_t
Definition ArrowTypes.h:117
Defining DataPointCompositeObject explicitly as copiable.
arrow::FixedSizeListArray type
Definition ArrowTypes.h:87
arrow::FixedSizeListArray type
Definition ArrowTypes.h:72
arrow::FixedSizeListArray type
Definition ArrowTypes.h:92
arrow::FixedSizeListArray type
Definition ArrowTypes.h:77
arrow::FixedSizeListArray type
Definition ArrowTypes.h:82