Main data type enumeration.
This enumeration provides a quick way to interrogate the category of a DataType instance.
Values:
A NULL type having no physical storage.
Boolean as 1 bit, LSB bit-packed ordering.
Unsigned 8-bit little-endian integer.
Signed 8-bit little-endian integer.
Unsigned 16-bit little-endian integer.
Signed 16-bit little-endian integer.
Unsigned 32-bit little-endian integer.
Signed 32-bit little-endian integer.
Unsigned 64-bit little-endian integer.
Signed 64-bit little-endian integer.
2-byte floating point value
4-byte floating point value
8-byte floating point value
UTF8 variable-length string as List<Char>
Variable-length bytes (no guarantee of UTF8-ness)
Fixed-size binary. Each value occupies the same number of bytes.
int32_t days since the UNIX epoch
int64_t milliseconds since the UNIX epoch
Exact timestamp encoded with int64 since UNIX epoch Default unit millisecond.
Time as signed 32-bit integer, representing either seconds or milliseconds since midnight.
Time as signed 64-bit integer, representing either microseconds or nanoseconds since midnight.
YEAR_MONTH interval in SQL style.
DAY_TIME interval in SQL style.
Precision- and scale-based decimal type with 128 bits.
Defined for backward-compatibility.
Precision- and scale-based decimal type with 256 bits.
A list of some logical data type.
Struct of logical types.
Sparse unions of logical types.
Dense unions of logical types.
Dictionary-encoded type, also called âcategoricalâ or âfactorâ in other programming languages.
Holds the dictionary value type but not the dictionary itself, which is part of the ArrayData struct
Map, a repeated struct logical type.
Custom data type, implemented by user.
Fixed size list of some logical type.
Measure of elapsed time in either seconds, milliseconds, microseconds or nanoseconds.
Like STRING, but with 64-bit offsets.
Like BINARY, but with 64-bit offsets.
Like LIST, but with 64-bit offsets.
Calendar interval type with three fields.
Run-end encoded data.
String (UTF8) view type with 4-byte prefix and inline small string optimization.
Bytes view type with 4-byte prefix and inline small string optimization.
A list of some logical data type represented by offset and size.
Like LIST_VIEW, but with 64-bit offsets and sizes.
Precision- and scale-based decimal type with 32 bits.
Precision- and scale-based decimal type with 64 bits.
Base class for all data types.
Data types in this library are all logical. They can be expressed as either a primitive physical type (bytes or bits of some fixed size), a nested type consisting of other data types, or another data type (e.g. a timestamp encoded as an int64).
Simple datatypes may be entirely described by their Type::type id, but complex datatypes are usually parametric.
Subclassed by arrow::BaseBinaryType, arrow::BinaryViewType, arrow::ExtensionType, arrow::FixedWidthType, arrow::NestedType, arrow::NullType
Public Functions
Return whether the types are equal.
Types that are logically convertible from one to another (e.g. List<UInt8> and Binary) are NOT equal.
Return whether the types are equal.
Return the child field at index i.
Return the children fields associated with this type.
Return the number of children fields associated with this type.
Apply the TypeVisitor::Visit() method specialized to the data type.
A string representation of the type, including any children.
Return hash value (excluding metadata in child fields)
A string name of the type, omitting any child fields.
0.7.0
Return the data type layout.
Children are not included.
Return the type category.
Return the type category of the storage type.
Returns the typeâs fixed byte width, if any.
Returns -1 for non-fixed-width types, and should only be used for subclasses of FixedWidthType
Returns the typeâs fixed bit width, if any.
Returns -1 for non-fixed-width types, and should only be used for subclasses of FixedWidthType
These functions are recommended for creating data types. They may return new objects or existing singletons, depending on the type requested.
Return a NullType instance.
Return a BooleanType instance.
Return a Int8Type instance.
Return a Int16Type instance.
Return a Int32Type instance.
Return a Int64Type instance.
Return a UInt8Type instance.
Return a UInt16Type instance.
Return a UInt32Type instance.
Return a UInt64Type instance.
Return a HalfFloatType instance.
Return a FloatType instance.
Return a DoubleType instance.
Return a StringType instance.
Return a StringViewType instance.
Return a LargeStringType instance.
Return a BinaryType instance.
Return a BinaryViewType instance.
Return a LargeBinaryType instance.
Return a Date32Type instance.
Return a Date64Type instance.
Create a FixedSizeBinaryType instance.
Create a DecimalType instance depending on the precision.
If the precision is greater than 38, a Decimal256Type is returned, otherwise a Decimal128Type.
Deprecated: prefer smallest_decimal
instead.
Create a the smallest DecimalType instance depending on precision.
Given the requested precision and scale, the smallest DecimalType which is able to represent that precision will be returned. As different bit-widths for decimal types are added, the concrete data type returned here can potentially change accordingly.
Create a Decimal32Type instance.
Create a Decimal64Type instance.
Create a Decimal128Type instance.
Create a Decimal256Type instance.
Create a LargeListType instance from its child Field type.
Create a LargeListType instance from its child DataType.
Create a ListViewType instance.
Create a ListViewType instance from its child Field type.
Create a LargetListViewType instance.
Create a LargetListViewType instance from its child Field type.
Create a MapType instance from its key and value DataTypes.
Create a MapType instance from its key DataType and value field.
The field override is provided to communicate nullability of the value.
Create a FixedSizeListType instance from its child Field type.
Create a FixedSizeListType instance from its child DataType.
Return a Duration instance (naming use _type to avoid namespace conflict with built in time classes).
Return a DayTimeIntervalType instance.
Return a MonthIntervalType instance.
Return a MonthDayNanoIntervalType instance.
Create a TimestampType instance from its unit.
Create a TimestampType instance from its unit and timezone.
Create a 32-bit time type instance.
Unit can be either SECOND or MILLI
Create a 64-bit time type instance.
Unit can be either MICRO or NANO
Create a StructType instance.
Create a StructType instance from (name, type) pairs.
Create a RunEndEncodedType instance.
Create a SparseUnionType instance.
Create a SparseUnionType instance.
Create a DenseUnionType instance.
Create a DenseUnionType instance.
Create a DictionaryType instance.
index_type â [in] the type of the dictionary indices (must be a signed integer)
dict_type â [in] the type of the values in the variable dictionary
ordered â [in] true if the order of the dictionary values has semantic meaning and should be preserved where possible
Concrete type class for always-null data.
Public Functions
A string representation of the type, including any children.
Return the data type layout.
Children are not included.
A string name of the type, omitting any child fields.
0.7.0
Concrete type class for boolean data.
Public Functions
Returns the typeâs fixed bit width, if any.
Returns -1 for non-fixed-width types, and should only be used for subclasses of FixedWidthType
Return the data type layout.
Children are not included.
#include <arrow/type.h>
Concrete type class for unsigned 8-bit integer data.
#include <arrow/type.h>
Concrete type class for signed 8-bit integer data.
#include <arrow/type.h>
Concrete type class for unsigned 16-bit integer data.
#include <arrow/type.h>
Concrete type class for signed 16-bit integer data.
#include <arrow/type.h>
Concrete type class for unsigned 32-bit integer data.
#include <arrow/type.h>
Concrete type class for signed 32-bit integer data.
#include <arrow/type.h>
Concrete type class for unsigned 64-bit integer data.
#include <arrow/type.h>
Concrete type class for signed 64-bit integer data.
#include <arrow/type.h>
Concrete type class for 16-bit floating-point data.
#include <arrow/type.h>
Concrete type class for 32-bit floating-point data (C âfloatâ)
#include <arrow/type.h>
Concrete type class for 64-bit floating-point data (C âdoubleâ)
#include <arrow/type.h>
Base type class for (fixed-size) decimal data.
Subclassed by arrow::Decimal128Type, arrow::Decimal256Type, arrow::Decimal32Type, arrow::Decimal64Type
Public Static Functions
Constructs concrete decimal types.
Returns the number of bytes needed for precision.
precision must be >= 1
#include <arrow/type.h>
Concrete type class for 32-bit decimal data.
Arrow decimals are fixed-point decimal numbers encoded as a scaled integer. The precision is the number of significant digits that the decimal type can represent; the scale is the number of digits after the decimal point (note the scale can be negative).
As an example, Decimal32Type(7, 3)
can exactly represent the numbers 1234.567 and -1234.567 (encoded internally as the 32-bit integers 1234567 and -1234567, respectively), but neither 12345.67 nor 123.4567.
Decimal32Type has a maximum precision of 9 significant digits (also available as Decimal32Type::kMaxPrecision). If higher precision is needed, consider using Decimal64Type, Decimal128Type or Decimal256Type.
Public Functions
Decimal32Type constructor that aborts on invalid input.
A string representation of the type, including any children.
A string name of the type, omitting any child fields.
0.7.0
Public Static Functions
Decimal32Type constructor that returns an error on invalid input.
#include <arrow/type.h>
Concrete type class for 64-bit decimal data.
Arrow decimals are fixed-point decimal numbers encoded as a scaled integer. The precision is the number of significant digits that the decimal type can represent; the scale is the number of digits after the decimal point (note the scale can be negative).
As an example, Decimal64Type(7, 3)
can exactly represent the numbers 1234.567 and -1234.567 (encoded internally as the 64-bit integers 1234567 and -1234567, respectively), but neither 12345.67 nor 123.4567.
Decimal64Type has a maximum precision of 18 significant digits (also available as Decimal64Type::kMaxPrecision). If higher precision is needed, consider using Decimal128Type or Decimal256Type.
Public Functions
Decimal32Type constructor that aborts on invalid input.
A string representation of the type, including any children.
A string name of the type, omitting any child fields.
0.7.0
Public Static Functions
Decimal32Type constructor that returns an error on invalid input.
#include <arrow/type.h>
Concrete type class for 128-bit decimal data.
Arrow decimals are fixed-point decimal numbers encoded as a scaled integer. The precision is the number of significant digits that the decimal type can represent; the scale is the number of digits after the decimal point (note the scale can be negative).
As an example, Decimal128Type(7, 3)
can exactly represent the numbers 1234.567 and -1234.567 (encoded internally as the 128-bit integers 1234567 and -1234567, respectively), but neither 12345.67 nor 123.4567.
Decimal128Type has a maximum precision of 38 significant digits (also available as Decimal128Type::kMaxPrecision). If higher precision is needed, consider using Decimal256Type.
Public Functions
Decimal128Type constructor that aborts on invalid input.
A string representation of the type, including any children.
A string name of the type, omitting any child fields.
0.7.0
Public Static Functions
Decimal128Type constructor that returns an error on invalid input.
#include <arrow/type.h>
Concrete type class for 256-bit decimal data.
Arrow decimals are fixed-point decimal numbers encoded as a scaled integer. The precision is the number of significant digits that the decimal type can represent; the scale is the number of digits after the decimal point (note the scale can be negative).
Decimal256Type has a maximum precision of 76 significant digits. (also available as Decimal256Type::kMaxPrecision).
For most use cases, the maximum precision offered by Decimal128Type is sufficient, and it will result in a more compact and more efficient encoding.
Public Functions
Decimal256Type constructor that aborts on invalid input.
A string representation of the type, including any children.
A string name of the type, omitting any child fields.
0.7.0
Public Static Functions
Decimal256Type constructor that returns an error on invalid input.
The unit for a time or timestamp DataType.
Values:
#include <arrow/type.h>
Base type for all date and time types.
Subclassed by arrow::DateType, arrow::DurationType, arrow::IntervalType, arrow::TimeType, arrow::TimestampType
Public Functions
Return the data type layout.
Children are not included.
#include <arrow/type.h>
Base type class for date data.
Subclassed by arrow::Date32Type, arrow::Date64Type
#include <arrow/type.h>
Concrete type class for 32-bit date data (as number of days since UNIX epoch)
Public Functions
Returns the typeâs fixed bit width, if any.
Returns -1 for non-fixed-width types, and should only be used for subclasses of FixedWidthType
A string representation of the type, including any children.
A string name of the type, omitting any child fields.
0.7.0
#include <arrow/type.h>
Concrete type class for 64-bit date data (as number of milliseconds since UNIX epoch)
Public Functions
Returns the typeâs fixed bit width, if any.
Returns -1 for non-fixed-width types, and should only be used for subclasses of FixedWidthType
A string representation of the type, including any children.
A string name of the type, omitting any child fields.
0.7.0
#include <arrow/type.h>
Base type class for time data.
Subclassed by arrow::Time32Type, arrow::Time64Type
#include <arrow/type.h>
Concrete type class for 32-bit time data (as number of seconds or milliseconds since midnight)
Public Functions
Returns the typeâs fixed bit width, if any.
Returns -1 for non-fixed-width types, and should only be used for subclasses of FixedWidthType
A string representation of the type, including any children.
A string name of the type, omitting any child fields.
0.7.0
#include <arrow/type.h>
Concrete type class for 64-bit time data (as number of microseconds or nanoseconds since midnight)
Public Functions
Returns the typeâs fixed bit width, if any.
Returns -1 for non-fixed-width types, and should only be used for subclasses of FixedWidthType
A string representation of the type, including any children.
A string name of the type, omitting any child fields.
0.7.0
#include <arrow/type.h>
Concrete type class for datetime data (as number of seconds, milliseconds, microseconds or nanoseconds since UNIX epoch)
If supplied, the timezone string should take either the form (i) âArea/Locationâ, with values drawn from the names in the IANA Time Zone Database (such as âEurope/Zurichâ); or (ii) â(+|-)HH:MMâ indicating an absolute offset from GMT (such as â-08:00â). To indicate a native UTC timestamp, one of the strings âUTCâ, âEtc/UTCâ or â+00:00â should be used.
If any non-empty string is supplied as the timezone for a TimestampType, then the Arrow field containing that timestamp type (and by extension the column associated with such a field) is considered âtimezone-awareâ. The integer arrays that comprise a timezone-aware column must contain UTC normalized datetime values, regardless of the contents of their timezone string. More precisely, (i) the producer of a timezone-aware column must populate its constituent arrays with valid UTC values (performing offset conversions from non-UTC values if necessary); and (ii) the consumer of a timezone-aware column may assume that the columnâs values are directly comparable (that is, with no offset adjustment required) to the values of any other timezone-aware column or to any other valid UTC datetime value (provided all values are expressed in the same units).
If a TimestampType is constructed without a timezone (or, equivalently, if the timezone supplied is an empty string) then the resulting Arrow field (column) is considered âtimezone-naiveâ. The producer of a timezone-naive column may populate its constituent integer arrays with datetime values from any timezone; the consumer of a timezone-naive column should make no assumptions about the interoperability or comparability of the values of such a column with those of any other timestamp column or datetime value.
If a timezone-aware field contains a recognized timezone, its values may be localized to that locale upon display; the values of timezone-naive fields must always be displayed âas isâ, with no localization performed on them.
Public Functions
Returns the typeâs fixed bit width, if any.
Returns -1 for non-fixed-width types, and should only be used for subclasses of FixedWidthType
A string representation of the type, including any children.
A string name of the type, omitting any child fields.
0.7.0
#include <arrow/type.h>
Subclassed by arrow::DayTimeIntervalType, arrow::MonthDayNanoIntervalType, arrow::MonthIntervalType
#include <arrow/type.h>
Represents a number of months.
Type representing a number of months. Corresponds to YearMonth type in Schema.fbs (years are defined as 12 months).
Public Functions
Returns the typeâs fixed bit width, if any.
Returns -1 for non-fixed-width types, and should only be used for subclasses of FixedWidthType
A string representation of the type, including any children.
A string name of the type, omitting any child fields.
0.7.0
#include <arrow/type.h>
Represents a number of days and milliseconds (fraction of day).
Public Functions
Returns the typeâs fixed bit width, if any.
Returns -1 for non-fixed-width types, and should only be used for subclasses of FixedWidthType
A string representation of the type, including any children.
A string name of the type, omitting any child fields.
0.7.0
#include <arrow/type.h>
#include <arrow/type.h>
Represents a number of months, days and nanoseconds between two dates.
All fields are independent from one another.
Public Functions
Returns the typeâs fixed bit width, if any.
Returns -1 for non-fixed-width types, and should only be used for subclasses of FixedWidthType
A string representation of the type, including any children.
A string name of the type, omitting any child fields.
0.7.0
#include <arrow/type.h>
#include <arrow/type.h>
Represents an elapsed time without any relation to a calendar artifact.
Public Functions
Returns the typeâs fixed bit width, if any.
Returns -1 for non-fixed-width types, and should only be used for subclasses of FixedWidthType
A string representation of the type, including any children.
A string name of the type, omitting any child fields.
0.7.0
#include <arrow/type.h>
Concrete type class for variable-size binary data.
Subclassed by arrow::StringType
Public Functions
Return the data type layout.
Children are not included.
A string representation of the type, including any children.
A string name of the type, omitting any child fields.
0.7.0
#include <arrow/type.h>
Concrete type class for variable-size binary view data.
Subclassed by arrow::StringViewType
Public Functions
Return the data type layout.
Children are not included.
A string representation of the type, including any children.
A string name of the type, omitting any child fields.
0.7.0
#include <arrow/type.h>
Variable length string or binary with inline optimization for small values (12 bytes or fewer).
This is similar to std::string_view except limited in size to INT32_MAX and at least the first four bytes of the string are copied inline (accessible without pointer dereference). This inline prefix allows failing comparisons early. Furthermore when dealing with short strings the CPU cache working set is reduced since many can be inline.
This union supports two states:
Entirely inlined string data
|----|--------------| ^ ^ | | size in-line string data, zero padded
Reference into a buffer
|----|----|----|----| ^ ^ ^ ^ | | | | size | | `------. prefix | | buffer index | offset in buffer
Adapted from TU Munichâs UmbraDB 1, Velox, DuckDB.
Alignment to 64 bits enables an aligned load of the size and prefix into a single 64 bit integer, which is useful to the comparison fast path.
Public Functions
The number of bytes viewed.
True if the viewâs data is entirely stored inline.
Return a pointer to the inline data of a view.
For inline views, this points to the entire data of the view. For other views, this points to the 4 byte prefix.
Public Members
#include <arrow/type.h>
Concrete type class for large variable-size binary data.
Subclassed by arrow::LargeStringType
Public Functions
Return the data type layout.
Children are not included.
A string representation of the type, including any children.
A string name of the type, omitting any child fields.
0.7.0
#include <arrow/type.h>
Concrete type class for variable-size string data, utf8-encoded.
Public Functions
A string representation of the type, including any children.
A string name of the type, omitting any child fields.
0.7.0
#include <arrow/type.h>
Concrete type class for variable-size string data, utf8-encoded.
Public Functions
A string representation of the type, including any children.
A string name of the type, omitting any child fields.
0.7.0
#include <arrow/type.h>
Concrete type class for large variable-size string data, utf8-encoded.
Public Functions
A string representation of the type, including any children.
A string name of the type, omitting any child fields.
0.7.0
#include <arrow/type.h>
Concrete type class for fixed-size binary data.
Subclassed by arrow::DecimalType
Public Functions
A string representation of the type, including any children.
A string name of the type, omitting any child fields.
0.7.0
Return the data type layout.
Children are not included.
Returns the typeâs fixed byte width, if any.
Returns -1 for non-fixed-width types, and should only be used for subclasses of FixedWidthType
Returns the typeâs fixed bit width, if any.
Returns -1 for non-fixed-width types, and should only be used for subclasses of FixedWidthType
#include <arrow/type.h>
Base class for all variable-size list data types.
Subclassed by arrow::FixedSizeListType, arrow::LargeListType, arrow::LargeListViewType, arrow::ListType, arrow::ListViewType
#include <arrow/type.h>
Concrete type class for list data.
List data is nested data where each value is a variable number of child items. Lists can be recursively nested, for example list(list(int32)).
Subclassed by arrow::MapType
Public Functions
Return the data type layout.
Children are not included.
A string representation of the type, including any children.
A string name of the type, omitting any child fields.
0.7.0
#include <arrow/type.h>
Concrete type class for large list data.
LargeListType is like ListType but with 64-bit rather than 32-bit offsets.
Public Functions
Return the data type layout.
Children are not included.
A string representation of the type, including any children.
A string name of the type, omitting any child fields.
0.7.0
#include <arrow/type.h>
Type class for array of list views.
Public Functions
Return the data type layout.
Children are not included.
A string representation of the type, including any children.
A string name of the type, omitting any child fields.
0.7.0
#include <arrow/type.h>
Concrete type class for large list-view data.
LargeListViewType is like ListViewType but with 64-bit rather than 32-bit offsets and sizes.
Public Functions
Return the data type layout.
Children are not included.
A string representation of the type, including any children.
A string name of the type, omitting any child fields.
0.7.0
#include <arrow/type.h>
Concrete type class for map data.
Map data is nested data where each value is a variable number of key-item pairs. Its physical representation is the same as a list of {key, item}
structs.
Maps can be recursively nested, for example map(utf8, map(utf8, int32)).
Public Functions
A string representation of the type, including any children.
A string name of the type, omitting any child fields.
0.7.0
#include <arrow/type.h>
Concrete type class for fixed size list data.
Public Functions
Return the data type layout.
Children are not included.
A string representation of the type, including any children.
A string name of the type, omitting any child fields.
0.7.0
#include <arrow/type.h>
Concrete type class for struct data.
Public Functions
Return the data type layout.
Children are not included.
A string representation of the type, including any children.
A string name of the type, omitting any child fields.
0.7.0
Returns null if name not found.
Return all fields having this name.
Returns -1 if name not found or if there are multiple fields having the same name.
Return the indices of all fields having this name in sorted order.
Create a new StructType with field added at given index.
Create a new StructType by removing the field at given index.
Create a new StructType by changing the field at given index.
#include <arrow/type.h>
Base type class for union data.
Subclassed by arrow::DenseUnionType, arrow::SparseUnionType
Public Functions
Return the data type layout.
Children are not included.
A string representation of the type, including any children.
The array of logical type ids.
For example, the first type in the union might be denoted by the id 5 (instead of 0).
An array mapping logical type ids to physical child ids.
#include <arrow/type.h>
Concrete type class for sparse union data.
A sparse union is a nested type where each logical value is taken from a single child. A buffer of 8-bit type ids indicates which child a given logical value is to be taken from.
In a sparse union, each child array should have the same length as the union array, regardless of the actual number of union values that refer to it.
Note that, unlike most other types, unions donât have a top-level validity bitmap.
Public Functions
A string name of the type, omitting any child fields.
0.7.0
#include <arrow/type.h>
Concrete type class for dense union data.
A dense union is a nested type where each logical value is taken from a single child, at a specific offset. A buffer of 8-bit type ids indicates which child a given logical value is to be taken from, and a buffer of 32-bit offsets indicates at which physical position in the given child array the logical value is to be taken from.
Unlike a sparse union, a dense union allows encoding only the child array values which are actually referred to by the union array. This is counterbalanced by the additional footprint of the offsets buffer, and the additional indirection cost when looking up values.
Note that, unlike most other types, unions donât have a top-level validity bitmap.
Public Functions
A string name of the type, omitting any child fields.
0.7.0
#include <arrow/type.h>
Type class for run-end encoded data.
Public Functions
Return the data type layout.
Children are not included.
A string representation of the type, including any children.
A string name of the type, omitting any child fields.
0.7.0
Dictionary-encoded value type with data-dependent dictionary.
Indices are represented by any integer types.
Public Functions
A string representation of the type, including any children.
A string name of the type, omitting any child fields.
0.7.0
Returns the typeâs fixed bit width, if any.
Returns -1 for non-fixed-width types, and should only be used for subclasses of FixedWidthType
Return the data type layout.
Children are not included.
The base class for custom / user-defined types.
Subclassed by arrow::extension::Bool8Type, arrow::extension::FixedShapeTensorType, arrow::extension::JsonExtensionType, arrow::extension::OpaqueType, arrow::extension::UuidType
Public Functions
The type of array used to represent this extension typeâs data.
Return the type category of the storage type.
Return the data type layout.
Children are not included.
A string representation of the type, including any children.
A string name of the type, omitting any child fields.
0.7.0
Returns the typeâs fixed byte width, if any.
Returns -1 for non-fixed-width types, and should only be used for subclasses of FixedWidthType
Returns the typeâs fixed bit width, if any.
Returns -1 for non-fixed-width types, and should only be used for subclasses of FixedWidthType
Unique name of extension type used to identify type for serialization.
the string name of the extension
Determine if two instances of the same extension types are equal.
Invoked from ExtensionType::Equals
other â [in] the type to compare this type with
bool true if type instances are equal
Wrap built-in Array type in a user-defined ExtensionArray instance.
data â [in] the physical storage for the extension type
Create an instance of the ExtensionType given the actual storage type and the serialized representation.
storage_type â [in] the physical storage type of the extension
serialized_data â [in] the serialized representation produced by Serialize
Create a serialized representation of the extension typeâs metadata.
The storage type will be handled automatically in IPC code paths
the serialized representation
Public Static Functions
Wrap the given storage array as an extension array.
Wrap the given chunked storage array as a chunked extension array.
Create a Field instance.
name â the field name
type â the field value type
nullable â whether the values are nullable, default true
metadata â any custom key-value metadata, default null
Create a Field instance with metadata.
The field will be assumed to be nullable.
name â the field name
type â the field value type
metadata â any custom key-value metadata
Create a Schema instance.
fields â the schemaâs fields
metadata â any custom key-value metadata, default null
schema shared_ptr to Schema
Create a Schema instance from (name, type) pairs.
The schemaâs fields will all be nullable with no associated metadata.
fields â (name, type) pairs of the schemaâs fields
metadata â any custom key-value metadata, default null
schema shared_ptr to Schema
Create a Schema instance.
fields â the schemaâs fields
endianness â the endianness of the data
metadata â any custom key-value metadata, default null
schema shared_ptr to Schema
Create a Schema instance.
The schemaâs fields will all be nullable with no associated metadata.
fields â (name, type) pairs of the schemaâs fields
endianness â the endianness of the data
metadata â any custom key-value metadata, default null
schema shared_ptr to Schema
The combination of a field name and data type, with optional metadata.
Fields are used to describe the individual constituents of a nested DataType or a Schema.
A fieldâs metadata is represented by a KeyValueMetadata instance, which holds arbitrary key-value pairs.
Public Functions
Return the fieldâs attached metadata.
Return whether the field has non-empty metadata.
Return a copy of this field with the given metadata attached to it.
EXPERIMENTAL: Return a copy of this field with the given metadata merged with existing metadata (any colliding keys will be overridden by the passed metadata)
Return a copy of this field without any metadata attached to it.
Return a copy of this field with the replaced type.
Return a copy of this field with the replaced name.
Return a copy of this field with the replaced nullability.
Merge the current field with a field of the same name.
The two fields must be compatible, i.e:
have the same name
have the same type, or of compatible types according to options
.
The metadata of the current field is preserved; the metadata of the other field is discarded.
Indicate if fields are equals.
other â [in] field to check equality with.
check_metadata â [in] controls if it should check for metadata equality.
true if fields are equal, false otherwise.
Indicate if fields are compatibles.
See the criteria of MergeWith.
true if fields are compatible, false otherwise.
Return a string representation ot the field.
show_metadata â [in] when true, if KeyValueMetadata is non-empty, print keys and values in the output
Return the field name.
Return the field data type.
Return whether the field is nullable.
Options that control the behavior of MergeWith
.
Options are to be added to allow type conversions, including integer widening, promotion from integer to float, or conversion to or from boolean.
Public Functions
Get a human-readable representation of the options.
Public Members
If true, a Field of NullType can be unified with a Field of another type.
The unified field will be of the other type and become nullable. Nullability will be promoted to the looser option (nullable if one is not nullable).
Allow a decimal to be unified with another decimal of the same width, adjusting scale and precision as appropriate.
May fail if the adjustment is not possible.
Allow a decimal to be promoted to a float.
The float type will not itself be promoted (e.g. Decimal128 + Float32 = Float32).
Allow an integer to be promoted to a decimal.
May fail if the decimal has insufficient precision to accommodate the integer (see promote_numeric_width).
Allow an integer of a given bit width to be promoted to a float; the result will be a float of an equal or greater bit width to both of the inputs.
Examples:
int8 + float32 = float32
int32 + float32 = float64
int32 + float64 = float64 Because an int32 cannot always be represented exactly in the 24 bits of a float32 mantissa.
Allow an unsigned integer of a given bit width to be promoted to a signed integer that fits into the signed type: uint + int16 = int16 When widening is needed, set promote_numeric_width to true: uint16 + int16 = int32.
Allow an integer, float, or decimal of a given bit width to be promoted to an equivalent type of a greater bit width.
Allow strings to be promoted to binary types.
Promotion of fixed size binary types to variable sized formats, and binary to large binary, and string to large string.
Second to millisecond, Time32 to Time64, Time32(SECOND) to Time32(MILLI), etc.
Allow promotion from a list to a large-list and from a fixed-size list to a variable sized list.
Unify dictionary index types and dictionary value types.
Allow merging ordered and non-ordered dictionaries.
The result will be ordered if and only if both inputs are ordered.
Public Static Functions
Get default options. Only NullType will be merged with other types.
Get permissive options.
All options are enabled, except promote_dictionary_ordered.
Sequence of arrow::Field objects describing the columns of a record batch or table data structure.
Public Functions
Returns true if all of the schema fields are equal.
Set endianness in the schema.
new Schema
Return endianness in the schema.
Indicate if endianness is equal to platform-native endianness.
Return the number of fields (columns) in the schema.
Return the ith schema element. Does not boundscheck.
Returns null if name not found.
Return the indices of all fields having this name in sorted order.
Returns -1 if name not found.
Return the indices of all fields having this name.
Indicate if field named name
can be found unambiguously in the schema.
Indicate if fields named names
can be found unambiguously in the schema.
The custom key-value metadata, if any.
metadata may be null
Render a string representation of the schema suitable for debugging.
show_metadata â [in] when true, if KeyValueMetadata is non-empty, print keys and values in the output
Replace field names with new names.
names â [in] new names
new Schema
Replace key-value metadata with new metadata.
metadata â [in] new KeyValueMetadata
new Schema
Return copy of Schema without the KeyValueMetadata.
Indicate that the Schema has non-empty KevValueMetadata.
Indicate that the Schema has distinct field names.
A container for key-value pair type metadata. Not thread-safe.
Represents a path to a nested field using indices of child fields.
For example, given indices {5, 9, 3} the field would be retrieved with schema->field(5)->type()->field(9)->type()->field(3)
Attempting to retrieve a child field using a FieldPath which is not valid for a given schema will raise an error. Invalid FieldPaths include:
an index is out of range
the path is empty (note: a default constructed FieldPath will be empty)
FieldPaths provide a number of accessors for drilling down to potentially nested children. They are overloaded for convenience to support Schema (returns a field), DataType (returns a child field), Field (returns a child field of this fieldâs type) Array (returns a child array), RecordBatch (returns a column).
Public Functions
Retrieve the referenced child Field from a Schema, Field, or DataType.
Retrieve the referenced column from a RecordBatch or Table.
Retrieve the referenced child from a ChunkedArray.
Retrieve the referenced child/column from an Array, ArrayData, ChunkedArray, RecordBatch, or Table.
Unlike FieldPath::Get
, these variants are not zero-copy and the retrieved childâs null bitmap is ANDed with its ancestorsâ
Public Functions
Descriptor of a (potentially nested) field within a schema.
Unlike FieldPath (which exclusively uses indices of child fields), FieldRef may reference a field by name. It is intended to replace parameters like int field_index
and const std::string& field_name
; it can be implicitly constructed from either a field index or a name.
Nested fields can be referenced as well. Given schema({field(âaâ, struct_({field(ânâ, null())})), field(âbâ, int32())})
the following all indicate the nested field named ânâ: FieldRef ref1(0, 0); FieldRef ref2(âaâ, 0); FieldRef ref3(âaâ, ânâ); FieldRef ref4(0, ânâ); ARROW_ASSIGN_OR_RAISE(FieldRef ref5, FieldRef::FromDotPath(â.a[0]â));
FieldPaths matching a FieldRef are retrieved using the member function FindAll. Multiple matches are possible because field names may be duplicated within a schema. For example: Schema a_is_ambiguous({field(âaâ, int32()), field(âaâ, float32())}); auto matches = FieldRef(âaâ).FindAll(a_is_ambiguous); assert(matches.size() == 2); assert(matches[0].Get(a_is_ambiguous)->Equals(a_is_ambiguous.field(0))); assert(matches[1].Get(a_is_ambiguous)->Equals(a_is_ambiguous.field(1)));
Convenience accessors are available which raise a helpful error if the field is not found or ambiguous, and for immediately calling FieldPath::Get to retrieve any matching children: auto maybe_match = FieldRef(âstructâ, âfield_i32â).FindOneOrNone(schema); auto maybe_column = FieldRef(âstructâ, âfield_i32â).GetOne(some_table);
Public Types
Public Functions
Construct a FieldRef using a string of indices.
The reference will be retrieved as: schema.fields[self.indices[0]].type.fields[self.indices[1]] â¦
Empty indices are not valid.
Construct a by-name FieldRef.
Multiple fields may match a by-name FieldRef: [f for f in schema.fields where f.name == self.name]
Equivalent to a single index string of indices.
Construct a nested FieldRef.
Convenience constructor for nested FieldRefs: each argument will be used to construct a FieldRef.
Return true if this ref is a name or a nested sequence of only names.
Useful for determining if iteration is possible without recursion or inner loops
Retrieve FieldPath of every child field which matches this FieldRef.
Convenience function which applies FindAll to argâs type or schema.
Convenience function: raise an error if matches is empty.
Convenience function: raise an error if matches contains multiple FieldPaths.
Retrieve FieldPath of a single child field which matches this FieldRef.
Emit an error if none or multiple match.
Retrieve FieldPath of a single child field which matches this FieldRef.
Emit an error if multiple match. An empty (invalid) FieldPath will be returned if none match.
Get all children matching this FieldRef.
Get all children matching this FieldRef.
Unlike FieldRef::GetAll
, this variant is not zero-copy and the retrieved childrenâs null bitmaps are ANDed with their ancestorsâ
Get the single child matching this FieldRef.
Emit an error if none or multiple match.
Get the single child matching this FieldRef.
Unlike FieldRef::GetOne
, this variant is not zero-copy and the retrieved childâs null bitmap is ANDed with its ancestorsâ
Get the single child matching this FieldRef.
Return nullptr if none match, emit an error if multiple match.
Get the single child matching this FieldRef.
Return nullptr if none match, emit an error if multiple match. Unlike FieldRef::GetOneOrNone
, this variant is not zero-copy and the retrieved childâs null bitmap is ANDed with its ancestorsâ
Public Static Functions
Parse a dot path into a FieldRef.
dot_path = â.â name | â[â digit+ â]â | dot_path+
Examples: â.alphaâ => FieldRef(âalphaâ) â[2]â => FieldRef(2) â.beta[3]â => FieldRef(âbetaâ, 3) â[5].gamma.delta[7]â => FieldRef(5, âgammaâ, âdeltaâ, 7) â.hello worldâ => FieldRef(âhello worldâ) Râ(.\[y\]\tho.\)â => FieldRef(Râ([y]\tho.\)â)
Note: When parsing a name, a â' preceding any other character will be dropped from the resulting name. Therefore if a name must contain the characters â.â, â', or â[â those must be escaped with a preceding â'.
Public Functions
Abstract type visitor class.
Subclass this to create a visitor that can be used with the DataType::Accept() method.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4