// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
#pragma once
#include <limits>
#include <memory>
#include <string>
#include <vector>
#include "arrow/util/macros.h"
#include "arrow/util/visibility.h"
namespace arrow {
template <typename T>
class Iterator;
template <typename T>
struct IterationTraits;
template <typename T>
class Result;
class Status;
namespace internal {
struct Empty;
} // namespace internal
template <typename T = internal::Empty>
class Future;
namespace util {
class Codec;
class CodecOptions;
} // namespace util
class Buffer;
class Device;
class MemoryManager;
class MemoryPool;
class MutableBuffer;
class ResizableBuffer;
using BufferVector = std::vector<std::shared_ptr<Buffer>>;
class DataType;
class Field;
class FieldRef;
class KeyValueMetadata;
enum class Endianness;
class Schema;
using DataTypeVector = std::vector<std::shared_ptr<DataType>>;
using FieldVector = std::vector<std::shared_ptr<Field>>;
class Array;
struct ArrayData;
struct ArraySpan;
class ArrayBuilder;
struct Scalar;
using ArrayDataVector = std::vector<std::shared_ptr<ArrayData>>;
using ArrayVector = std::vector<std::shared_ptr<Array>>;
using ScalarVector = std::vector<std::shared_ptr<Scalar>>;
class ChunkedArray;
class RecordBatch;
struct RecordBatchWithMetadata;
class RecordBatchReader;
class AsyncRecordBatchReader;
class Table;
struct Datum;
struct TypeHolder;
using ChunkedArrayVector = std::vector<std::shared_ptr<ChunkedArray>>;
using RecordBatchVector = std::vector<std::shared_ptr<RecordBatch>>;
using RecordBatchIterator = Iterator<std::shared_ptr<RecordBatch>>;
class DictionaryType;
class DictionaryArray;
struct DictionaryScalar;
class NullType;
class NullArray;
class NullBuilder;
struct NullScalar;
class FixedWidthType;
class BooleanType;
class BooleanArray;
class BooleanBuilder;
struct BooleanScalar;
class BinaryType;
class BinaryArray;
class BinaryBuilder;
struct BinaryScalar;
class BinaryViewType;
class BinaryViewArray;
class BinaryViewBuilder;
struct BinaryViewScalar;
class LargeBinaryType;
class LargeBinaryArray;
class LargeBinaryBuilder;
struct LargeBinaryScalar;
class FixedSizeBinaryType;
class FixedSizeBinaryArray;
class FixedSizeBinaryBuilder;
struct FixedSizeBinaryScalar;
class StringType;
class StringArray;
class StringBuilder;
struct StringScalar;
class StringViewType;
class StringViewArray;
class StringViewBuilder;
struct StringViewScalar;
class LargeStringType;
class LargeStringArray;
class LargeStringBuilder;
struct LargeStringScalar;
class ListType;
class ListArray;
class ListBuilder;
struct ListScalar;
class LargeListType;
class LargeListArray;
class LargeListBuilder;
struct LargeListScalar;
class ListViewType;
class ListViewArray;
class ListViewBuilder;
struct ListViewScalar;
class LargeListViewType;
class LargeListViewArray;
class LargeListViewBuilder;
struct LargeListViewScalar;
class MapType;
class MapArray;
class MapBuilder;
struct MapScalar;
class FixedSizeListType;
class FixedSizeListArray;
class FixedSizeListBuilder;
struct FixedSizeListScalar;
class StructType;
class StructArray;
class StructBuilder;
struct StructScalar;
class Decimal32;
class Decimal64;
class Decimal128;
class Decimal256;
class DecimalType;
class Decimal32Type;
class Decimal64Type;
class Decimal128Type;
class Decimal256Type;
class Decimal32Array;
class Decimal64Array;
class Decimal128Array;
class Decimal256Array;
class Decimal32Builder;
class Decimal64Builder;
class Decimal128Builder;
class Decimal256Builder;
struct Decimal32Scalar;
struct Decimal64Scalar;
struct Decimal128Scalar;
struct Decimal256Scalar;
struct UnionMode {
enum type { SPARSE, DENSE };
};
class SparseUnionType;
class SparseUnionArray;
class SparseUnionBuilder;
struct SparseUnionScalar;
class DenseUnionType;
class DenseUnionArray;
class DenseUnionBuilder;
struct DenseUnionScalar;
class RunEndEncodedType;
class RunEndEncodedArray;
class RunEndEncodedBuilder;
struct RunEndEncodedScalar;
template <typename TypeClass>
class NumericArray;
template <typename TypeClass>
class NumericBuilder;
template <typename TypeClass>
class NumericTensor;
#define _NUMERIC_TYPE_DECL(KLASS) \
class KLASS##Type; \
using KLASS##Array = NumericArray<KLASS##Type>; \
using KLASS##Builder = NumericBuilder<KLASS##Type>; \
struct KLASS##Scalar; \
using KLASS##Tensor = NumericTensor<KLASS##Type>;
_NUMERIC_TYPE_DECL(Int8)
_NUMERIC_TYPE_DECL(Int16)
_NUMERIC_TYPE_DECL(Int32)
_NUMERIC_TYPE_DECL(Int64)
_NUMERIC_TYPE_DECL(UInt8)
_NUMERIC_TYPE_DECL(UInt16)
_NUMERIC_TYPE_DECL(UInt32)
_NUMERIC_TYPE_DECL(UInt64)
_NUMERIC_TYPE_DECL(HalfFloat)
_NUMERIC_TYPE_DECL(Float)
_NUMERIC_TYPE_DECL(Double)
#undef _NUMERIC_TYPE_DECL
enum class DateUnit : char { DAY = 0, MILLI = 1 };
class DateType;
class Date32Type;
using Date32Array = NumericArray<Date32Type>;
using Date32Builder = NumericBuilder<Date32Type>;
struct Date32Scalar;
class Date64Type;
using Date64Array = NumericArray<Date64Type>;
using Date64Builder = NumericBuilder<Date64Type>;
struct Date64Scalar;
struct ARROW_EXPORT TimeUnit {
/// The unit for a time or timestamp DataType
enum type { SECOND = 0, MILLI = 1, MICRO = 2, NANO = 3 };
/// Iterate over all valid time units
static const std::vector<TimeUnit::type>& values();
};
class TimeType;
class Time32Type;
using Time32Array = NumericArray<Time32Type>;
using Time32Builder = NumericBuilder<Time32Type>;
struct Time32Scalar;
class Time64Type;
using Time64Array = NumericArray<Time64Type>;
using Time64Builder = NumericBuilder<Time64Type>;
struct Time64Scalar;
class TimestampType;
using TimestampArray = NumericArray<TimestampType>;
using TimestampBuilder = NumericBuilder<TimestampType>;
struct TimestampScalar;
class MonthIntervalType;
using MonthIntervalArray = NumericArray<MonthIntervalType>;
using MonthIntervalBuilder = NumericBuilder<MonthIntervalType>;
struct MonthIntervalScalar;
class DayTimeIntervalType;
class DayTimeIntervalArray;
class DayTimeIntervalBuilder;
struct DayTimeIntervalScalar;
class MonthDayNanoIntervalType;
class MonthDayNanoIntervalArray;
class MonthDayNanoIntervalBuilder;
struct MonthDayNanoIntervalScalar;
class DurationType;
using DurationArray = NumericArray<DurationType>;
using DurationBuilder = NumericBuilder<DurationType>;
struct DurationScalar;
class ExtensionType;
class ExtensionArray;
struct ExtensionScalar;
class Tensor;
class SparseTensor;
// ----------------------------------------------------------------------
struct Type {
/// \brief Main data type enumeration
///
/// This enumeration provides a quick way to interrogate the category
/// of a DataType instance.
enum type {
/// A NULL type having no physical storage
NA = 0,
/// Boolean as 1 bit, LSB bit-packed ordering
BOOL = 1,
/// Unsigned 8-bit little-endian integer
UINT8 = 2,
/// Signed 8-bit little-endian integer
INT8 = 3,
/// Unsigned 16-bit little-endian integer
UINT16 = 4,
/// Signed 16-bit little-endian integer
INT16 = 5,
/// Unsigned 32-bit little-endian integer
UINT32 = 6,
/// Signed 32-bit little-endian integer
INT32 = 7,
Loading ...