iceberg-cpp
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
iceberg::ListType Class Reference

A data type representing a list of values. More...

#include <type.h>

Inheritance diagram for iceberg::ListType:
iceberg::NestedType iceberg::Type iceberg::util::Formattable

Public Member Functions

 ListType (SchemaField element)
 Construct a list of the given element. The name of the child field should be "element".
 
 ListType (int32_t field_id, std::shared_ptr< Type > type, bool optional)
 Construct a list of the given element type.
 
TypeId type_id () const override
 Get the type ID.
 
const SchemaFieldelement () const
 
std::string ToString () const override
 Get a user-readable string representation.
 
std::span< const SchemaFieldfields () 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.
 
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).
 

Static Public Attributes

static constexpr const TypeId kTypeId = TypeId::kList
 
static constexpr const std::string_view kElementName = "element"
 

Protected Member Functions

bool Equals (const Type &other) const override
 Compare two types for equality.
 

Protected Attributes

SchemaField element_
 

Additional Inherited Members

- Public Types inherited from iceberg::NestedType
using SchemaFieldConstRef = std::reference_wrapper< const SchemaField >
 

Detailed Description

A data type representing a list of values.

Member Function Documentation

◆ Equals()

bool iceberg::ListType::Equals ( const Type other) const
overrideprotectedvirtual

Compare two types for equality.

Implements iceberg::Type.

◆ fields()

std::span< const SchemaField > iceberg::ListType::fields ( ) const
overridevirtual

Get a view of the child fields.

Implements iceberg::NestedType.

◆ GetFieldById()

Result< std::optional< NestedType::SchemaFieldConstRef > > iceberg::ListType::GetFieldById ( int32_t  field_id) const
overridevirtual

Get a field by field ID.

Note
This is O(1) complexity.

Implements iceberg::NestedType.

◆ GetFieldByIndex()

Result< std::optional< NestedType::SchemaFieldConstRef > > iceberg::ListType::GetFieldByIndex ( int32_t  index) const
overridevirtual

Get a field by index.

Note
This is O(1) complexity.

Implements iceberg::NestedType.

◆ GetFieldByName() [1/2]

Result< std::optional< NestedType::SchemaFieldConstRef > > iceberg::ListType::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::ListType::ToString ( ) const
overridevirtual

Get a user-readable string representation.

Implements iceberg::util::Formattable.

◆ type_id()

TypeId iceberg::ListType::type_id ( ) const
overridevirtual

Get the type ID.

Implements iceberg::Type.


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