Apache Arrow (C++)
A columnar in-memory analytics layer designed to accelerate big data.
Public Member Functions | List of all members
arrow::Schema Class Reference

Sequence of arrow::Field objects describing the columns of a record batch or table data structure. More...

#include <arrow/type.h>

Public Member Functions

 Schema (const std::vector< std::shared_ptr< Field >> &fields, const std::shared_ptr< const KeyValueMetadata > &metadata=NULLPTR)
 
 Schema (std::vector< std::shared_ptr< Field >> &&fields, const std::shared_ptr< const KeyValueMetadata > &metadata=NULLPTR)
 
virtual ~Schema ()=default
 
bool Equals (const Schema &other) const
 Returns true if all of the schema fields are equal. More...
 
std::shared_ptr< Fieldfield (int i) const
 Return the ith schema element. Does not boundscheck. More...
 
std::shared_ptr< FieldGetFieldByName (const std::string &name) const
 Returns null if name not found. More...
 
int64_t GetFieldIndex (const std::string &name) const
 Returns -1 if name not found. More...
 
const std::vector< std::shared_ptr< Field > > & fields () const
 
std::shared_ptr< const KeyValueMetadatametadata () const
 The custom key-value metadata, if any. More...
 
std::string ToString () const
 Render a string representation of the schema suitable for debugging. More...
 
Status AddField (int i, const std::shared_ptr< Field > &field, std::shared_ptr< Schema > *out) const
 
Status RemoveField (int i, std::shared_ptr< Schema > *out) const
 
Status AddMetadata (const std::shared_ptr< const KeyValueMetadata > &metadata, std::shared_ptr< Schema > *out) const
 
std::shared_ptr< SchemaAddMetadata (const std::shared_ptr< const KeyValueMetadata > &metadata) const
 Replace key-value metadata with new metadata. More...
 
std::shared_ptr< SchemaRemoveMetadata () const
 Return copy of Schema without the KeyValueMetadata. More...
 
int num_fields () const
 Return the number of fields (columns) in the schema. More...
 

Detailed Description

Sequence of arrow::Field objects describing the columns of a record batch or table data structure.

Constructor & Destructor Documentation

◆ Schema() [1/2]

arrow::Schema::Schema ( const std::vector< std::shared_ptr< Field >> &  fields,
const std::shared_ptr< const KeyValueMetadata > &  metadata = NULLPTR 
)
explicit

◆ Schema() [2/2]

arrow::Schema::Schema ( std::vector< std::shared_ptr< Field >> &&  fields,
const std::shared_ptr< const KeyValueMetadata > &  metadata = NULLPTR 
)
explicit

◆ ~Schema()

virtual arrow::Schema::~Schema ( )
virtualdefault

Member Function Documentation

◆ AddField()

Status arrow::Schema::AddField ( int  i,
const std::shared_ptr< Field > &  field,
std::shared_ptr< Schema > *  out 
) const

◆ AddMetadata() [1/2]

Status arrow::Schema::AddMetadata ( const std::shared_ptr< const KeyValueMetadata > &  metadata,
std::shared_ptr< Schema > *  out 
) const
Note
Deprecated since 0.8.0

◆ AddMetadata() [2/2]

std::shared_ptr<Schema> arrow::Schema::AddMetadata ( const std::shared_ptr< const KeyValueMetadata > &  metadata) const

Replace key-value metadata with new metadata.

Parameters
[in]metadatanew KeyValueMetadata
Returns
new Schema

◆ Equals()

bool arrow::Schema::Equals ( const Schema other) const

Returns true if all of the schema fields are equal.

◆ field()

std::shared_ptr<Field> arrow::Schema::field ( int  i) const
inline

Return the ith schema element. Does not boundscheck.

◆ fields()

const std::vector<std::shared_ptr<Field> >& arrow::Schema::fields ( ) const
inline

◆ GetFieldByName()

std::shared_ptr<Field> arrow::Schema::GetFieldByName ( const std::string &  name) const

Returns null if name not found.

◆ GetFieldIndex()

int64_t arrow::Schema::GetFieldIndex ( const std::string &  name) const

Returns -1 if name not found.

◆ metadata()

std::shared_ptr<const KeyValueMetadata> arrow::Schema::metadata ( ) const

The custom key-value metadata, if any.

Returns
metadata may be null

◆ num_fields()

int arrow::Schema::num_fields ( ) const
inline

Return the number of fields (columns) in the schema.

◆ RemoveField()

Status arrow::Schema::RemoveField ( int  i,
std::shared_ptr< Schema > *  out 
) const

◆ RemoveMetadata()

std::shared_ptr<Schema> arrow::Schema::RemoveMetadata ( ) const

Return copy of Schema without the KeyValueMetadata.

◆ ToString()

std::string arrow::Schema::ToString ( ) const

Render a string representation of the schema suitable for debugging.


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