|
iceberg-cpp
|
A data type representing a struct with nested fields. More...
#include <type.h>
Public Member Functions | |
| StructType (std::vector< SchemaField > fields) | |
| TypeId | type_id () const override |
| Get the type ID. | |
| std::string | ToString () const override |
| Get a user-readable string representation. | |
| std::span< const SchemaField > | fields () const override |
| Get a view of the child fields. | |
| Result< std::optional< SchemaFieldConstRef > > | GetFieldById (int32_t field_id) const override |
| Get a field by field ID. | |
| Result< std::optional< SchemaFieldConstRef > > | GetFieldByIndex (int32_t index) const override |
| Get a field by index. | |
| Result< std::optional< SchemaFieldConstRef > > | GetFieldByName (std::string_view name, bool case_sensitive) const override |
| Get a field by name. Return an error Status if the field name is not unique; prefer GetFieldById or GetFieldByIndex when possible. | |
| std::unique_ptr< Schema > | ToSchema () const |
| virtual Result< std::optional< SchemaFieldConstRef > > | GetFieldByName (std::string_view name, bool case_sensitive) const=0 |
| Get a field by name. Return an error Status if the field name is not unique; prefer GetFieldById or GetFieldByIndex when possible. | |
| Result< std::optional< SchemaFieldConstRef > > | GetFieldByName (std::string_view name) const |
| Get a field by name (case-sensitive). | |
Public Member Functions inherited from iceberg::NestedType | |
| bool | is_primitive () const override |
| Is this a primitive type (may not have child fields)? | |
| bool | is_nested () const override |
| Is this a nested type (may have child fields)? | |
| Result< std::optional< SchemaFieldConstRef > > | GetFieldByName (std::string_view name) const |
| Get a field by name (case-sensitive). | |
Public Member Functions inherited from iceberg::Type | |
| bool | is_struct () const |
| Is this a struct type? | |
| bool | is_list () const |
| Is this a list type? | |
| bool | is_map () const |
| Is this a map type? | |
| bool | is_variant () const |
| Is this a variant type? | |
Static Public Attributes | |
| static constexpr TypeId | kTypeId = TypeId::kStruct |
Protected Member Functions | |
| bool | Equals (const Type &other) const override |
| Compare two types for equality. | |
Static Protected Member Functions | |
| static Result< std::unordered_map< int32_t, SchemaFieldConstRef > > | InitFieldById (const StructType &) |
| static Result< std::unordered_map< std::string_view, SchemaFieldConstRef > > | InitFieldByName (const StructType &) |
| static Result< std::unordered_map< std::string, SchemaFieldConstRef > > | InitFieldByLowerCaseName (const StructType &) |
Protected Attributes | |
| std::vector< SchemaField > | fields_ |
| Lazy< InitFieldById > | field_by_id_ |
| Lazy< InitFieldByName > | field_by_name_ |
| Lazy< InitFieldByLowerCaseName > | field_by_lowercase_name_ |
Additional Inherited Members | |
Public Types inherited from iceberg::NestedType | |
| using | SchemaFieldConstRef = std::reference_wrapper< const SchemaField > |
A data type representing a struct with nested fields.
|
overrideprotectedvirtual |
Compare two types for equality.
Implements iceberg::Type.
|
overridevirtual |
Get a view of the child fields.
Implements iceberg::NestedType.
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
Get a field by name. Return an error Status if the field name is not unique; prefer GetFieldById or GetFieldByIndex when possible.
Implements iceberg::NestedType.
|
virtual |
Get a field by name. Return an error Status if the field name is not unique; prefer GetFieldById or GetFieldByIndex when possible.
Implements iceberg::NestedType.
|
overridevirtual |
Get a user-readable string representation.
Implements iceberg::util::Formattable.
|
overridevirtual |
Get the type ID.
Implements iceberg::Type.