iceberg-cpp
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
iceberg::NestedType Class Referenceabstract

A data type that has child fields. More...

#include <type.h>

Inheritance diagram for iceberg::NestedType:
iceberg::Type iceberg::util::Formattable iceberg::ListType iceberg::MapType iceberg::StructType iceberg::Schema

Public Types

using SchemaFieldConstRef = std::reference_wrapper< const SchemaField >
 

Public Member Functions

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)?
 
virtual std::span< const SchemaFieldfields () const =0
 Get a view of the child fields.
 
virtual Result< std::optional< SchemaFieldConstRef > > GetFieldById (int32_t field_id) const =0
 Get a field by field ID.
 
virtual Result< std::optional< SchemaFieldConstRef > > GetFieldByIndex (int32_t index) const =0
 Get a field by index.
 
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::Type
virtual TypeId type_id () const =0
 Get the type ID.
 
- Public Member Functions inherited from iceberg::util::Formattable
virtual std::string ToString () const =0
 Get a user-readable string representation.
 

Additional Inherited Members

- Protected Member Functions inherited from iceberg::Type
virtual bool Equals (const Type &other) const =0
 Compare two types for equality.
 

Detailed Description

A data type that has child fields.

Member Function Documentation

◆ fields()

virtual std::span< const SchemaField > iceberg::NestedType::fields ( ) const
pure virtual

Get a view of the child fields.

Implemented in iceberg::StructType, iceberg::ListType, and iceberg::MapType.

◆ GetFieldById()

virtual Result< std::optional< SchemaFieldConstRef > > iceberg::NestedType::GetFieldById ( int32_t  field_id) const
pure virtual

Get a field by field ID.

Note
This is O(1) complexity.

Implemented in iceberg::StructType, iceberg::ListType, and iceberg::MapType.

◆ GetFieldByIndex()

virtual Result< std::optional< SchemaFieldConstRef > > iceberg::NestedType::GetFieldByIndex ( int32_t  index) const
pure virtual

Get a field by index.

Note
This is O(1) complexity.

Implemented in iceberg::StructType, iceberg::ListType, and iceberg::MapType.

◆ GetFieldByName()

virtual Result< std::optional< SchemaFieldConstRef > > iceberg::NestedType::GetFieldByName ( std::string_view  name,
bool  case_sensitive 
) const
pure 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.

Implemented in iceberg::StructType, iceberg::ListType, iceberg::MapType, iceberg::StructType, iceberg::ListType, and iceberg::MapType.

◆ is_nested()

bool iceberg::NestedType::is_nested ( ) const
inlineoverridevirtual

Is this a nested type (may have child fields)?

Implements iceberg::Type.

◆ is_primitive()

bool iceberg::NestedType::is_primitive ( ) const
inlineoverridevirtual

Is this a primitive type (may not have child fields)?

Implements iceberg::Type.


The documentation for this class was generated from the following files: