Lance C/C++ Bindings
C ABI and header-only C++ RAII wrappers for the Lance columnar data format
Loading...
Searching...
No Matches
lance::LanceSchema Class Reference

#include <lance/detail/declarations.hpp>

Public Member Functions

 LanceSchema (::LanceSchema *schema)
 
 LanceSchema (LanceSchema &&) noexcept=default
 
LanceSchema & operator= (LanceSchema &&) noexcept=default
 
 LanceSchema (const LanceSchema &)=delete
 
LanceSchema & operator= (const LanceSchema &)=delete
 
LanceSchema clone () const
 Independently owned native clone.
 
int32_t field_id (const std::string &column) const
 
void to_arrow (ArrowSchema *out) const
 
const ::LanceSchema * c_handle () const
 

Static Public Member Functions

static LanceSchema from_dataset (const Dataset &dataset)
 Clone the current snapshot schema of a dataset.
 
static LanceSchema from_fragment (const Fragment &fragment)
 Clone the staged snapshot schema of a fragment.
 
static LanceSchema from_operation (const Operation &operation)
 
static LanceSchema project (const LanceSchema &schema, const std::vector< std::string > &columns)
 
static LanceSchema from_arrow (const ArrowSchema *schema)
 

Detailed Description

Move-only owner of a native Lance schema.

Unlike the Arrow export, a native schema preserves field and parent IDs, logical types, encodings, dictionary values, nested metadata, field order and nullability. A clone remains valid after the dataset, fragment or operation that produced it is closed.

Definition at line 2830 of file declarations.hpp.

Constructor & Destructor Documentation

◆ LanceSchema() [1/3]

lance::LanceSchema::LanceSchema ( ::LanceSchema * schema)
explicit

◆ LanceSchema() [2/3]

lance::LanceSchema::LanceSchema ( LanceSchema && )
defaultnoexcept

◆ LanceSchema() [3/3]

lance::LanceSchema::LanceSchema ( const LanceSchema & )
delete

Member Function Documentation

◆ c_handle()

const ::LanceSchema * lance::LanceSchema::c_handle ( ) const

◆ clone()

LanceSchema lance::LanceSchema::clone ( ) const

Independently owned native clone.

◆ field_id()

int32_t lance::LanceSchema::field_id ( const std::string & column) const

Native Lance field ID for a column path. Throws when the path does not resolve.

◆ from_arrow()

static LanceSchema lance::LanceSchema::from_arrow ( const ArrowSchema * schema)
static

Build a native schema from a borrowed Arrow schema. Fields without a lance:field_id metadata entry receive fresh native IDs; existing IDs, dictionaries, and metadata are preserved. Throws on native validation failure.

◆ from_dataset()

static LanceSchema lance::LanceSchema::from_dataset ( const Dataset & dataset)
static

Clone the current snapshot schema of a dataset.

◆ from_fragment()

static LanceSchema lance::LanceSchema::from_fragment ( const Fragment & fragment)
static

Clone the staged snapshot schema of a fragment.

◆ from_operation()

static LanceSchema lance::LanceSchema::from_operation ( const Operation & operation)
static

Clone the in-memory schema of an Overwrite, Merge or Project operation. Other kinds throw LANCE_ERR_NOT_SUPPORTED.

◆ operator=() [1/2]

LanceSchema & lance::LanceSchema::operator= ( const LanceSchema & )
delete

◆ operator=() [2/2]

LanceSchema & lance::LanceSchema::operator= ( LanceSchema && )
defaultnoexcept

◆ project()

static LanceSchema lance::LanceSchema::project ( const LanceSchema & schema,
const std::vector< std::string > & columns )
static

Project onto ordered native column paths. Paths, order, unknown-column errors and empty-selection behavior are native Schema::project.

◆ to_arrow()

void lance::LanceSchema::to_arrow ( ArrowSchema * out) const

Export an Arrow interoperability view. out is caller-owned and must be released exactly once. Arrow cannot represent every native detail.


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