47using Scalar = std::variant<std::monostate,
55 std::shared_ptr<StructLike>,
56 std::shared_ptr<ArrayLike>,
57 std::shared_ptr<MapLike>>;
85 virtual size_t size()
const = 0;
102 virtual size_t size()
const = 0;
109 std::span<const size_t> position_path,
110 std::vector<bool> is_optional);
121 return accessor_(struct_like);
137 std::shared_ptr<Type> type_;
138 std::function<Result<Scalar>(
const StructLike&)> accessor_;
139 std::vector<size_t> position_path_;
141 std::vector<bool> is_optional_;
An immutable array-like wrapper.
Definition struct_like.h:76
virtual Result< Scalar > GetElement(size_t pos) const =0
Get the array element at the given position.
virtual size_t size() const =0
Get the number of elements in the array.
Represents 128-bit fixed-point decimal numbers. The max decimal precision that can be safely represen...
Definition decimal.h:46
Literal is a literal value that is associated with a primitive type.
Definition literal.h:42
An immutable map-like wrapper.
Definition struct_like.h:89
virtual size_t size() const =0
Get the number of entries in the map.
virtual Result< Scalar > GetValue(size_t pos) const =0
Get the value at the given position.
virtual Result< Scalar > GetKey(size_t pos) const =0
Get the key at the given position.
An accessor for a struct-like object.
Definition struct_like.h:106
const std::vector< size_t > & position_path() const
Get the position path of the value that this accessor is bound to.
Definition struct_like.h:134
Result< Literal > GetLiteral(const StructLike &struct_like) const
Get the literal value at the given position.
const Type & type() const
Get the type of the value that this accessor is bound to.
Definition struct_like.h:131
Result< Scalar > Get(const StructLike &struct_like) const
Get the scalar value at the given position. A null optional parent returns monostate; a null required...
Definition struct_like.h:120
An immutable struct-like wrapper.
Definition struct_like.h:63
virtual Result< Scalar > GetField(size_t pos) const =0
Get the field value at the given position.
virtual size_t num_fields() const =0
Get the number of fields in the struct.
Interface for a data type for a field.
Definition type.h:44
Definition expected.h:1199
128-bit fixed-point decimal numbers. Adapted from Apache Arrow with only Decimal128 support....
Define typed literal values used by expressions.
Core Apache Iceberg C++ APIs.
Definition arrow_io_util.h:34
std::variant< std::monostate, bool, int32_t, int64_t, float, double, std::string_view, Decimal, std::shared_ptr< StructLike >, std::shared_ptr< ArrayLike >, std::shared_ptr< MapLike > > Scalar
A scalar value depending on its data type.
Definition struct_like.h:57
Result< Scalar > LiteralToScalar(const Literal &literal)
Convert a Literal to a Scalar.
Define Result, Status, and error helpers.