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

A type combined with a name. More...

#include <schema_field.h>

Inheritance diagram for iceberg::SchemaField:
iceberg::util::Formattable

Public Member Functions

 SchemaField (int32_t field_id, std::string_view name, std::shared_ptr< Type > type, bool optional, std::string_view doc={})
 Construct a field.
 
int32_t field_id () const
 Get the field ID.
 
std::string_view name () const
 Get the field name.
 
const std::shared_ptr< Type > & type () const
 Get the field type.
 
bool optional () const
 Get whether the field is optional.
 
std::string_view doc () const
 Get the field documentation.
 
std::string ToString () const override
 Get a user-readable string representation.
 
Status Validate () const
 
SchemaField AsRequired () const
 
SchemaField AsOptional () const
 

Static Public Member Functions

static SchemaField MakeOptional (int32_t field_id, std::string_view name, std::shared_ptr< Type > type, std::string_view doc={})
 Construct an optional (nullable) field.
 
static SchemaField MakeRequired (int32_t field_id, std::string_view name, std::shared_ptr< Type > type, std::string_view doc={})
 Construct a required (non-null) field.
 

Static Public Attributes

static constexpr int32_t kInvalidFieldId = -1
 

Friends

bool operator== (const SchemaField &lhs, const SchemaField &rhs)
 

Detailed Description

A type combined with a name.

Constructor & Destructor Documentation

◆ SchemaField()

iceberg::SchemaField::SchemaField ( int32_t  field_id,
std::string_view  name,
std::shared_ptr< Type type,
bool  optional,
std::string_view  doc = {} 
)

Construct a field.

Parameters
[in]field_idThe field ID.
[in]nameThe field name.
[in]typeThe field type.
[in]optionalWhether values of this field are required or nullable.
[in]docOptional documentation string for the field.

Member Function Documentation

◆ ToString()

std::string iceberg::SchemaField::ToString ( ) const
overridevirtual

Get a user-readable string representation.

Implements iceberg::util::Formattable.


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