Apache Arrow (C++)
A columnar in-memory analytics layer designed to accelerate big data.
type_traits.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 #ifndef ARROW_TYPE_TRAITS_H
19 #define ARROW_TYPE_TRAITS_H
20 
21 #include <memory>
22 #include <type_traits>
23 
24 #include "arrow/type_fwd.h"
25 #include "arrow/util/bit-util.h"
26 
27 namespace arrow {
28 
29 //
30 // Per-type type traits
31 //
32 
33 template <typename T>
34 struct TypeTraits {};
35 
36 template <>
40  constexpr static bool is_parameter_free = false;
41 };
42 
43 template <>
45  using ArrayType = UInt8Array;
47  using TensorType = UInt8Tensor;
48  static inline int64_t bytes_required(int64_t elements) { return elements; }
49  constexpr static bool is_parameter_free = true;
50  static inline std::shared_ptr<DataType> type_singleton() { return uint8(); }
51 };
52 
53 template <>
55  using ArrayType = Int8Array;
57  using TensorType = Int8Tensor;
58  static inline int64_t bytes_required(int64_t elements) { return elements; }
59  constexpr static bool is_parameter_free = true;
60  static inline std::shared_ptr<DataType> type_singleton() { return int8(); }
61 };
62 
63 template <>
65  using ArrayType = UInt16Array;
67  using TensorType = UInt16Tensor;
68 
69  static inline int64_t bytes_required(int64_t elements) {
70  return elements * sizeof(uint16_t);
71  }
72  constexpr static bool is_parameter_free = true;
73  static inline std::shared_ptr<DataType> type_singleton() { return uint16(); }
74 };
75 
76 template <>
78  using ArrayType = Int16Array;
80  using TensorType = Int16Tensor;
81 
82  static inline int64_t bytes_required(int64_t elements) {
83  return elements * sizeof(int16_t);
84  }
85  constexpr static bool is_parameter_free = true;
86  static inline std::shared_ptr<DataType> type_singleton() { return int16(); }
87 };
88 
89 template <>
91  using ArrayType = UInt32Array;
93  using TensorType = UInt32Tensor;
94 
95  static inline int64_t bytes_required(int64_t elements) {
96  return elements * sizeof(uint32_t);
97  }
98  constexpr static bool is_parameter_free = true;
99  static inline std::shared_ptr<DataType> type_singleton() { return uint32(); }
100 };
101 
102 template <>
104  using ArrayType = Int32Array;
106  using TensorType = Int32Tensor;
107 
108  static inline int64_t bytes_required(int64_t elements) {
109  return elements * sizeof(int32_t);
110  }
111  constexpr static bool is_parameter_free = true;
112  static inline std::shared_ptr<DataType> type_singleton() { return int32(); }
113 };
114 
115 template <>
117  using ArrayType = UInt64Array;
119  using TensorType = UInt64Tensor;
120 
121  static inline int64_t bytes_required(int64_t elements) {
122  return elements * sizeof(uint64_t);
123  }
124  constexpr static bool is_parameter_free = true;
125  static inline std::shared_ptr<DataType> type_singleton() { return uint64(); }
126 };
127 
128 template <>
130  using ArrayType = Int64Array;
132  using TensorType = Int64Tensor;
133 
134  static inline int64_t bytes_required(int64_t elements) {
135  return elements * sizeof(int64_t);
136  }
137  constexpr static bool is_parameter_free = true;
138  static inline std::shared_ptr<DataType> type_singleton() { return int64(); }
139 };
140 
141 template <>
145 
146  static inline int64_t bytes_required(int64_t elements) {
147  return elements * sizeof(int64_t);
148  }
149  constexpr static bool is_parameter_free = true;
150  static inline std::shared_ptr<DataType> type_singleton() { return date64(); }
151 };
152 
153 template <>
157 
158  static inline int64_t bytes_required(int64_t elements) {
159  return elements * sizeof(int32_t);
160  }
161  constexpr static bool is_parameter_free = true;
162  static inline std::shared_ptr<DataType> type_singleton() { return date32(); }
163 };
164 
165 template <>
169 
170  static inline int64_t bytes_required(int64_t elements) {
171  return elements * sizeof(int64_t);
172  }
173  constexpr static bool is_parameter_free = false;
174 };
175 
176 template <>
180 
181  static inline int64_t bytes_required(int64_t elements) {
182  return elements * sizeof(int32_t);
183  }
184  constexpr static bool is_parameter_free = false;
185 };
186 
187 template <>
191 
192  static inline int64_t bytes_required(int64_t elements) {
193  return elements * sizeof(int64_t);
194  }
195  constexpr static bool is_parameter_free = false;
196 };
197 
198 template <>
200  using ArrayType = HalfFloatArray;
202  using TensorType = HalfFloatTensor;
203 
204  static inline int64_t bytes_required(int64_t elements) {
205  return elements * sizeof(uint16_t);
206  }
207  constexpr static bool is_parameter_free = true;
208  static inline std::shared_ptr<DataType> type_singleton() { return float16(); }
209 };
210 
211 template <>
213  using ArrayType = FloatArray;
215  using TensorType = FloatTensor;
216 
217  static inline int64_t bytes_required(int64_t elements) {
218  return static_cast<int64_t>(elements * sizeof(float));
219  }
220  constexpr static bool is_parameter_free = true;
221  static inline std::shared_ptr<DataType> type_singleton() { return float32(); }
222 };
223 
224 template <>
226  using ArrayType = DoubleArray;
228  using TensorType = DoubleTensor;
229 
230  static inline int64_t bytes_required(int64_t elements) {
231  return static_cast<int64_t>(elements * sizeof(double));
232  }
233  constexpr static bool is_parameter_free = true;
234  static inline std::shared_ptr<DataType> type_singleton() { return float64(); }
235 };
236 
237 template <>
241  constexpr static bool is_parameter_free = false;
242 };
243 
244 template <>
248 
249  static inline int64_t bytes_required(int64_t elements) {
250  return BitUtil::BytesForBits(elements);
251  }
252  constexpr static bool is_parameter_free = true;
253  static inline std::shared_ptr<DataType> type_singleton() { return boolean(); }
254 };
255 
256 template <>
260  constexpr static bool is_parameter_free = true;
261  static inline std::shared_ptr<DataType> type_singleton() { return utf8(); }
262 };
263 
264 template <>
268  constexpr static bool is_parameter_free = true;
269  static inline std::shared_ptr<DataType> type_singleton() { return binary(); }
270 };
271 
272 template <>
276  constexpr static bool is_parameter_free = false;
277 };
278 
279 template <>
283  constexpr static bool is_parameter_free = false;
284 };
285 
286 template <>
290  constexpr static bool is_parameter_free = false;
291 };
292 
293 template <>
296  constexpr static bool is_parameter_free = false;
297 };
298 
299 template <>
302  constexpr static bool is_parameter_free = false;
303 };
304 
305 //
306 // Useful type predicates
307 //
308 
309 template <typename T>
310 using is_number = std::is_base_of<Number, T>;
311 
312 template <typename T>
313 struct has_c_type {
314  static constexpr bool value =
315  (std::is_base_of<PrimitiveCType, T>::value || std::is_base_of<DateType, T>::value ||
316  std::is_base_of<TimeType, T>::value || std::is_base_of<TimestampType, T>::value);
317 };
318 
319 template <typename T>
320 struct is_8bit_int {
321  static constexpr bool value =
322  (std::is_same<UInt8Type, T>::value || std::is_same<Int8Type, T>::value);
323 };
324 
325 template <typename T>
326 using enable_if_8bit_int = typename std::enable_if<is_8bit_int<T>::value>::type;
327 
328 template <typename T>
330  typename std::enable_if<std::is_base_of<PrimitiveCType, T>::value>::type;
331 
332 template <typename T>
333 using enable_if_date = typename std::enable_if<std::is_base_of<DateType, T>::value>::type;
334 
335 template <typename T>
336 using enable_if_integer =
337  typename std::enable_if<std::is_base_of<Integer, T>::value>::type;
338 
339 template <typename T>
341  typename std::enable_if<std::is_base_of<Integer, T>::value &&
342  std::is_signed<typename T::c_type>::value>::type;
343 
344 template <typename T>
346  typename std::enable_if<std::is_base_of<Integer, T>::value &&
347  std::is_unsigned<typename T::c_type>::value>::type;
348 
349 template <typename T>
351  typename std::enable_if<std::is_base_of<FloatingPoint, T>::value>::type;
352 
353 template <typename T>
354 using enable_if_time = typename std::enable_if<std::is_base_of<TimeType, T>::value>::type;
355 
356 template <typename T>
357 using enable_if_timestamp =
358  typename std::enable_if<std::is_base_of<TimestampType, T>::value>::type;
359 
360 template <typename T>
361 using enable_if_has_c_type = typename std::enable_if<has_c_type<T>::value>::type;
362 
363 template <typename T>
364 using enable_if_null = typename std::enable_if<std::is_same<NullType, T>::value>::type;
365 
366 template <typename T>
367 using enable_if_binary =
368  typename std::enable_if<std::is_base_of<BinaryType, T>::value>::type;
369 
370 template <typename T>
371 using enable_if_boolean =
372  typename std::enable_if<std::is_same<BooleanType, T>::value>::type;
373 
374 template <typename T>
376  typename std::enable_if<std::is_base_of<FixedSizeBinaryType, T>::value>::type;
377 
378 template <typename T>
379 using enable_if_list = typename std::enable_if<std::is_base_of<ListType, T>::value>::type;
380 
381 template <typename T>
382 using enable_if_number = typename std::enable_if<is_number<T>::value>::type;
383 
384 namespace detail {
385 
386 // Not all type classes have a c_type
387 template <typename T>
388 struct as_void {
389  using type = void;
390 };
391 
392 // The partial specialization will match if T has the ATTR_NAME member
393 #define GET_ATTR(ATTR_NAME, DEFAULT) \
394  template <typename T, typename Enable = void> \
395  struct GetAttr_##ATTR_NAME { \
396  using type = DEFAULT; \
397  }; \
398  \
399  template <typename T> \
400  struct GetAttr_##ATTR_NAME<T, typename as_void<typename T::ATTR_NAME>::type> { \
401  using type = typename T::ATTR_NAME; \
402  };
403 
404 GET_ATTR(c_type, void);
405 GET_ATTR(TypeClass, void);
406 
407 #undef GET_ATTR
408 
409 } // namespace detail
410 
411 #define PRIMITIVE_TRAITS(T) \
412  using TypeClass = \
413  typename std::conditional<std::is_base_of<DataType, T>::value, T, \
414  typename detail::GetAttr_TypeClass<T>::type>::type; \
415  using c_type = typename detail::GetAttr_c_type<TypeClass>::type
416 
417 template <typename T>
419  PRIMITIVE_TRAITS(T);
420  static constexpr bool value =
421  std::is_integral<c_type>::value && std::is_unsigned<c_type>::value;
422 };
423 
424 template <typename T>
425 struct IsSignedInt {
426  PRIMITIVE_TRAITS(T);
427  static constexpr bool value =
428  std::is_integral<c_type>::value && std::is_signed<c_type>::value;
429 };
430 
431 template <typename T>
432 struct IsInteger {
433  PRIMITIVE_TRAITS(T);
434  static constexpr bool value = std::is_integral<c_type>::value;
435 };
436 
437 template <typename T>
439  PRIMITIVE_TRAITS(T);
440  static constexpr bool value = std::is_floating_point<c_type>::value;
441 };
442 
443 template <typename T>
444 struct IsNumeric {
445  PRIMITIVE_TRAITS(T);
446  static constexpr bool value = std::is_arithmetic<c_type>::value;
447 };
448 
449 static inline bool is_integer(Type::type type_id) {
450  switch (type_id) {
451  case Type::UINT8:
452  case Type::INT8:
453  case Type::UINT16:
454  case Type::INT16:
455  case Type::UINT32:
456  case Type::INT32:
457  case Type::UINT64:
458  case Type::INT64:
459  return true;
460  default:
461  break;
462  }
463  return false;
464 }
465 
466 static inline bool is_floating(Type::type type_id) {
467  switch (type_id) {
468  case Type::HALF_FLOAT:
469  case Type::FLOAT:
470  case Type::DOUBLE:
471  return true;
472  default:
473  break;
474  }
475  return false;
476 }
477 
478 static inline bool is_primitive(Type::type type_id) {
479  switch (type_id) {
480  case Type::NA:
481  case Type::BOOL:
482  case Type::UINT8:
483  case Type::INT8:
484  case Type::UINT16:
485  case Type::INT16:
486  case Type::UINT32:
487  case Type::INT32:
488  case Type::UINT64:
489  case Type::INT64:
490  case Type::HALF_FLOAT:
491  case Type::FLOAT:
492  case Type::DOUBLE:
493  case Type::DATE32:
494  case Type::DATE64:
495  case Type::TIME32:
496  case Type::TIME64:
497  case Type::TIMESTAMP:
498  case Type::INTERVAL:
499  return true;
500  default:
501  break;
502  }
503  return false;
504 }
505 
506 static inline bool is_binary_like(Type::type type_id) {
507  switch (type_id) {
508  case Type::BINARY:
509  case Type::STRING:
510  return true;
511  default:
512  break;
513  }
514  return false;
515 }
516 
517 static inline bool is_dictionary(Type::type type_id) {
518  return type_id == Type::DICTIONARY;
519 }
520 
521 } // namespace arrow
522 
523 #endif // ARROW_TYPE_TRAITS_H
Concrete type class for struct data.
Definition: type.h:494
Concrete Array class for fixed-size binary data.
Definition: array.h:572
Definition: array.h:370
static int64_t bytes_required(int64_t elements)
Definition: type_traits.h:217
DoubleTensor TensorType
Definition: type_traits.h:228
NumericArray< Time32Type > Time32Array
Definition: type_fwd.h:122
Builder class for UTF8 strings.
Definition: builder.h:881
NumericBuilder< FloatType > FloatBuilder
Definition: builder.h:416
A NULL type having no physical storage.
Definition: type.h:50
typename std::enable_if< std::is_same< BooleanType, T >::value >::type enable_if_boolean
Definition: type_traits.h:372
NumericBuilder< Time32Type > Time32Builder
Definition: builder.h:410
Concrete type class for 16-bit floating-point data.
Definition: type.h:394
Builder class for variable-length binary data.
Definition: builder.h:835
NumericBuilder< Int64Type > Int64Builder
Definition: builder.h:408
typename std::enable_if< std::is_base_of< TimestampType, T >::value >::type enable_if_timestamp
Definition: type_traits.h:358
UInt32Tensor TensorType
Definition: type_traits.h:93
typename std::enable_if< std::is_base_of< PrimitiveCType, T >::value >::type enable_if_primitive_ctype
Definition: type_traits.h:330
static std::shared_ptr< DataType > type_singleton()
Definition: type_traits.h:269
std::shared_ptr< DataType > date64()
Return a Date64Type instance.
Concrete type class for unsigned 8-bit integer data.
Definition: type.h:338
static int64_t bytes_required(int64_t elements)
Definition: type_traits.h:204
type
Definition: type.h:48
typename std::enable_if< std::is_base_of< FloatingPoint, T >::value >::type enable_if_floating_point
Definition: type_traits.h:351
static constexpr bool value
Definition: type_traits.h:446
Unsigned 16-bit little-endian integer.
Definition: type.h:62
UInt8Array ArrayType
Definition: type_traits.h:45
Concrete type class for 64-bit floating-point data (C "double")
Definition: type.h:410
Unsigned 32-bit little-endian integer.
Definition: type.h:68
std::shared_ptr< DataType > int16()
Return a Int16Type instance.
static int64_t bytes_required(int64_t elements)
Definition: type_traits.h:108
std::shared_ptr< DataType > uint8()
Return a UInt8Type instance.
std::shared_ptr< DataType > binary()
Return a BinaryType instance.
Unsigned 8-bit little-endian integer.
Definition: type.h:56
static int64_t bytes_required(int64_t elements)
Definition: type_traits.h:170
static int64_t bytes_required(int64_t elements)
Definition: type_traits.h:192
static int64_t bytes_required(int64_t elements)
Definition: type_traits.h:146
UInt32Array ArrayType
Definition: type_traits.h:91
Int16Array ArrayType
Definition: type_traits.h:78
Concrete Array class for boolean data.
Definition: array.h:399
Signed 8-bit little-endian integer.
Definition: type.h:59
NumericArray< Date64Type > Date64Array
Definition: type_fwd.h:114
Concrete type class for 64-bit date data (as number of milliseconds since UNIX epoch) ...
Definition: type.h:610
static int64_t bytes_required(int64_t elements)
Definition: type_traits.h:95
static std::shared_ptr< DataType > type_singleton()
Definition: type_traits.h:261
Definition: type_traits.h:432
Definition: type_traits.h:444
std::shared_ptr< DataType > uint16()
Return a UInt16Type instance.
std::shared_ptr< DataType > int32()
Return a Int32Type instance.
static constexpr bool value
Definition: type_traits.h:427
NumericBuilder< Int16Type > Int16Builder
Definition: builder.h:406
static constexpr bool value
Definition: type_traits.h:420
HalfFloatTensor TensorType
Definition: type_traits.h:202
NumericBuilder< UInt16Type > UInt16Builder
Definition: builder.h:401
UInt64Tensor TensorType
Definition: type_traits.h:119
#define GET_ATTR(ATTR_NAME, DEFAULT)
Definition: type_traits.h:393
Dictionary aka Category type.
Definition: type.h:132
Time as signed 64-bit integer, representing either microseconds or nanoseconds since midnight...
Definition: type.h:113
NumericBuilder< Int8Type > Int8Builder
Definition: builder.h:405
static std::shared_ptr< DataType > type_singleton()
Definition: type_traits.h:99
std::shared_ptr< DataType > uint32()
Return a UInt32Type instance.
NumericBuilder< Int32Type > Int32Builder
Definition: builder.h:407
static std::shared_ptr< DataType > type_singleton()
Definition: type_traits.h:60
Signed 32-bit little-endian integer.
Definition: type.h:71
UInt64Array ArrayType
Definition: type_traits.h:117
static std::shared_ptr< DataType > type_singleton()
Definition: type_traits.h:253
static std::shared_ptr< DataType > type_singleton()
Definition: type_traits.h:125
NumericBuilder< UInt32Type > UInt32Builder
Definition: builder.h:402
Base class for all Builders that emit an Array of a scalar numerical type.
Definition: builder.h:360
Time as signed 32-bit integer, representing either seconds or milliseconds since midnight.
Definition: type.h:109
Int32Tensor TensorType
Definition: type_traits.h:106
static int64_t bytes_required(int64_t elements)
Definition: type_traits.h:158
typename std::enable_if< std::is_base_of< TimeType, T >::value >::type enable_if_time
Definition: type_traits.h:354
static constexpr bool value
Definition: type_traits.h:314
Int32Array ArrayType
Definition: type_traits.h:104
int32_t days since the UNIX epoch
Definition: type.h:98
Definition: builder.h:619
Definition: type_traits.h:34
FloatTensor TensorType
Definition: type_traits.h:215
std::shared_ptr< DataType > uint64()
Return a UInt64Type instance.
typename std::enable_if< std::is_base_of< Integer, T >::value &&std::is_unsigned< typename T::c_type >::value >::type enable_if_unsigned_integer
Definition: type_traits.h:347
static int64_t bytes_required(int64_t elements)
Definition: type_traits.h:249
4-byte floating point value
Definition: type.h:83
Signed 16-bit little-endian integer.
Definition: type.h:65
static std::shared_ptr< DataType > type_singleton()
Definition: type_traits.h:162
NumericBuilder< UInt8Type > UInt8Builder
Definition: builder.h:400
std::shared_ptr< DataType > int8()
Return a Int8Type instance.
Definition: type_traits.h:438
Int16Tensor TensorType
Definition: type_traits.h:80
DoubleArray ArrayType
Definition: type_traits.h:226
Int64Array ArrayType
Definition: type_traits.h:130
static int64_t bytes_required(int64_t elements)
Definition: type_traits.h:134
Concrete type class for unsigned 16-bit integer data.
Definition: type.h:352
Definition: type.h:688
std::shared_ptr< DataType > float32()
Return a FloatType instance.
typename std::enable_if< is_8bit_int< T >::value >::type enable_if_8bit_int
Definition: type_traits.h:326
UInt16Array ArrayType
Definition: type_traits.h:65
NumericBuilder< HalfFloatType > HalfFloatBuilder
Definition: builder.h:415
Boolean as 1 bit, LSB bit-packed ordering.
Definition: type.h:53
Signed 64-bit little-endian integer.
Definition: type.h:77
static int64_t bytes_required(int64_t elements)
Definition: type_traits.h:69
Concrete type class for unsigned 32-bit integer data.
Definition: type.h:366
Variable-length bytes (no guarantee of UTF8-ness)
Definition: type.h:92
Concrete type class for always-null data.
Definition: type.h:311
static int64_t bytes_required(int64_t elements)
Definition: type_traits.h:82
NumericBuilder< Time64Type > Time64Builder
Definition: builder.h:411
Concrete type class for variable-size binary data.
Definition: type.h:445
FloatArray ArrayType
Definition: type_traits.h:213
Concrete type class for boolean data.
Definition: type.h:324
Concrete type class for list data.
Definition: type.h:422
Exact timestamp encoded with int64 since UNIX epoch Default unit millisecond.
Definition: type.h:105
Concrete type class for variable-size string data, utf8-encoded.
Definition: type.h:482
static constexpr bool value
Definition: type_traits.h:440
std::shared_ptr< DataType > date32()
Return a Date32Type instance.
Definition: type_traits.h:313
std::shared_ptr< DataType > int64()
Return a Int64Type instance.
static std::shared_ptr< DataType > type_singleton()
Definition: type_traits.h:138
typename std::enable_if< std::is_base_of< Integer, T >::value >::type enable_if_integer
Definition: type_traits.h:337
Definition: builder.h:914
Int8Array ArrayType
Definition: type_traits.h:55
static std::shared_ptr< DataType > type_singleton()
Definition: type_traits.h:86
Concrete Array class for variable-size string (utf-8) data.
Definition: array.h:548
NumericBuilder< Date32Type > Date32Builder
Definition: builder.h:412
UInt16Tensor TensorType
Definition: type_traits.h:67
typename std::enable_if< std::is_base_of< BinaryType, T >::value >::type enable_if_binary
Definition: type_traits.h:368
typename std::enable_if< std::is_base_of< Integer, T >::value &&std::is_signed< typename T::c_type >::value >::type enable_if_signed_integer
Definition: type_traits.h:342
Top-level namespace for Apache Arrow C++ API.
Definition: adapter.h:32
static int64_t bytes_required(int64_t elements)
Definition: type_traits.h:58
std::shared_ptr< DataType > boolean()
Return a BooleanType instance.
static std::shared_ptr< DataType > type_singleton()
Definition: type_traits.h:208
NumericArray< Time64Type > Time64Array
Definition: type_fwd.h:126
static int64_t bytes_required(int64_t elements)
Definition: type_traits.h:181
static constexpr bool value
Definition: type_traits.h:321
Concrete Array class for list data.
Definition: array.h:422
Concrete type class for 128-bit decimal data.
Definition: type.h:535
static std::shared_ptr< DataType > type_singleton()
Definition: type_traits.h:73
Concrete type class for 32-bit floating-point data (C "float")
Definition: type.h:402
Concrete type class for signed 16-bit integer data.
Definition: type.h:359
Append, Resize and Reserve methods are acting on StructBuilder.
Definition: builder.h:983
Definition: type_traits.h:320
static int64_t bytes_required(int64_t elements)
Definition: type_traits.h:230
8-byte floating point value
Definition: type.h:86
static int64_t bytes_required(int64_t elements)
Definition: type_traits.h:48
typename std::enable_if< std::is_base_of< ListType, T >::value >::type enable_if_list
Definition: type_traits.h:379
HalfFloatArray ArrayType
Definition: type_traits.h:200
Concrete type class for signed 32-bit integer data.
Definition: type.h:373
NumericArray< TimestampType > TimestampArray
Definition: type_fwd.h:130
Concrete type class for 32-bit date data (as number of days since UNIX epoch)
Definition: type.h:593
std::shared_ptr< DataType > float64()
Return a DoubleType instance.
static std::shared_ptr< DataType > type_singleton()
Definition: type_traits.h:50
Concrete Array class for variable-size binary data.
Definition: array.h:480
UInt8Tensor TensorType
Definition: type_traits.h:47
int64_t milliseconds since the UNIX epoch
Definition: type.h:101
Definition: builder.h:959
Definition: type_traits.h:425
Concrete Array class for union data.
Definition: array.h:654
NumericBuilder< DoubleType > DoubleBuilder
Definition: builder.h:417
typename std::enable_if< std::is_base_of< DateType, T >::value >::type enable_if_date
Definition: type_traits.h:333
static std::shared_ptr< DataType > type_singleton()
Definition: type_traits.h:221
NumericBuilder< Date64Type > Date64Builder
Definition: builder.h:413
std::shared_ptr< DataType > utf8()
Return a StringType instance.
UTF8 variable-length string as List<Char>
Definition: type.h:89
NumericBuilder< UInt64Type > UInt64Builder
Definition: builder.h:403
Unsigned 64-bit little-endian integer.
Definition: type.h:74
Concrete Array class for 128-bit decimal data.
Definition: array.h:604
Concrete Array class for dictionary data.
Definition: array.h:751
std::shared_ptr< DataType > float16()
Return a HalfFloatType instance.
std::is_base_of< Number, T > is_number
Definition: type_traits.h:310
Concrete type class for dictionary data.
Definition: type.h:741
Definition: type.h:673
NumericArray< Date32Type > Date32Array
Definition: type_fwd.h:118
Concrete type class for unsigned 64-bit integer data.
Definition: type.h:380
typename std::enable_if< is_number< T >::value >::type enable_if_number
Definition: type_traits.h:382
Int64Tensor TensorType
Definition: type_traits.h:132
static std::shared_ptr< DataType > type_singleton()
Definition: type_traits.h:150
static std::shared_ptr< DataType > type_singleton()
Definition: type_traits.h:112
static int64_t bytes_required(int64_t elements)
Definition: type_traits.h:121
Concrete Array class for struct data.
Definition: array.h:623
Concrete type class for signed 8-bit integer data.
Definition: type.h:345
typename std::enable_if< std::is_base_of< FixedSizeBinaryType, T >::value >::type enable_if_fixed_size_binary
Definition: type_traits.h:376
2-byte floating point value
Definition: type.h:80
Definition: type.h:658
typename std::enable_if< has_c_type< T >::value >::type enable_if_has_c_type
Definition: type_traits.h:361
Definition: builder.h:208
Concrete type class for union data.
Definition: type.h:552
YEAR_MONTH or DAY_TIME interval in SQL style.
Definition: type.h:116
static constexpr bool value
Definition: type_traits.h:434
Concrete type class for signed 64-bit integer data.
Definition: type.h:387
Definition: type_traits.h:418
Builder class for variable-length list array value types.
Definition: builder.h:794
typename std::enable_if< std::is_same< NullType, T >::value >::type enable_if_null
Definition: type_traits.h:364
Int8Tensor TensorType
Definition: type_traits.h:57
NumericBuilder< TimestampType > TimestampBuilder
Definition: builder.h:409
Concrete type class for fixed-size binary data.
Definition: type.h:461
Degenerate null type Array.
Definition: array.h:327
static std::shared_ptr< DataType > type_singleton()
Definition: type_traits.h:234