A data type representing a struct with nested fields.
More...
#include <type.h>
|
|
| 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).
|
| |
| 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).
|
| |
|
|
static constexpr TypeId | kTypeId = TypeId::kStruct |
| |
|
| bool | Equals (const Type &other) const override |
| | Compare two types for equality.
|
| |
|
|
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 &) |
| |
|
|
std::vector< SchemaField > | fields_ |
| |
|
Lazy< InitFieldById > | field_by_id_ |
| |
|
Lazy< InitFieldByName > | field_by_name_ |
| |
|
Lazy< InitFieldByLowerCaseName > | field_by_lowercase_name_ |
| |
|
|
using | SchemaFieldConstRef = std::reference_wrapper< const SchemaField > |
| |
A data type representing a struct with nested fields.
◆ Equals()
| bool iceberg::StructType::Equals |
( |
const Type & |
other | ) |
const |
|
overrideprotectedvirtual |
◆ fields()
| std::span< const SchemaField > iceberg::StructType::fields |
( |
| ) |
const |
|
overridevirtual |
◆ GetFieldById()
| Result< std::optional< NestedType::SchemaFieldConstRef > > iceberg::StructType::GetFieldById |
( |
int32_t |
field_id | ) |
const |
|
overridevirtual |
◆ GetFieldByIndex()
| Result< std::optional< NestedType::SchemaFieldConstRef > > iceberg::StructType::GetFieldByIndex |
( |
int32_t |
index | ) |
const |
|
overridevirtual |
◆ GetFieldByName() [1/2]
| Result< std::optional< NestedType::SchemaFieldConstRef > > iceberg::StructType::GetFieldByName |
( |
std::string_view |
name, |
|
|
bool |
case_sensitive |
|
) |
| const |
|
overridevirtual |
Get a field by name. Return an error Status if the field name is not unique; prefer GetFieldById or GetFieldByIndex when possible.
- Note
- This is O(1) complexity.
Implements iceberg::NestedType.
◆ GetFieldByName() [2/2]
| virtual Result< std::optional< SchemaFieldConstRef > > iceberg::NestedType::GetFieldByName |
( |
std::string_view |
name, |
|
|
bool |
case_sensitive |
|
) |
| const |
|
virtual |
Get a field by name. Return an error Status if the field name is not unique; prefer GetFieldById or GetFieldByIndex when possible.
- Note
- This is O(1) complexity.
Implements iceberg::NestedType.
◆ ToString()
| std::string iceberg::StructType::ToString |
( |
| ) |
const |
|
overridevirtual |
◆ type_id()
| TypeId iceberg::StructType::type_id |
( |
| ) |
const |
|
overridevirtual |
The documentation for this class was generated from the following files:
- iceberg/type.h
- iceberg/type.cc