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

Cached state for ProjectBatch over one input/output schema pair. More...

#include <arrow_c_data_util_internal.h>

Public Types

using ProjectBatchState = std::shared_ptr< void >
 
using ProjectBatchFunction = auto(*)(ArrowArray *input_batch, std::span< const int32_t > row_indices, ProjectionContext &projection) -> Result< ArrowArray >
 

Public Member Functions

 ProjectionContext (ProjectionContext &&) noexcept
 
ProjectionContextoperator= (ProjectionContext &&) noexcept
 
 ProjectionContext (const ProjectionContext &)=delete
 
ProjectionContextoperator= (const ProjectionContext &)=delete
 
const Schemainput_schema () const
 
const Schemaoutput_schema () const
 
const ArrowSchemainput_arrow_schema () const
 
const ArrowSchemaoutput_arrow_schema () const
 
std::span< const int32_t > selected_field_indices () const
 
ProjectBatchFunction project_batch_function () const
 
ProjectBatchState & project_batch_state ()
 

Static Public Member Functions

static void RegisterProjectBatchFunction (ProjectBatchFunction project_batch_function)
 Register a custom implementation for ProjectBatch.
 
static bool HasProjectBatchFunction ()
 Returns true when a custom implementation has been registered.
 
static auto ResolveProjectBatchFunction () -> ProjectBatchFunction
 Resolve the registered ProjectBatch implementation.
 
static Result< ProjectionContextMake (const Schema &input_schema, const Schema &output_schema, ProjectBatchFunction project_batch_function)
 Build reusable projection state for a validated schema pair.
 

Detailed Description

Cached state for ProjectBatch over one input/output schema pair.

Exported because this internal utility is shared across library translation units.

Member Function Documentation

◆ Make()

Result< ProjectionContext > iceberg::ProjectionContext::Make ( const Schema input_schema,
const Schema output_schema,
ProjectionContext::ProjectBatchFunction  project_batch_function 
)
static

Build reusable projection state for a validated schema pair.

Parameters
input_schemaSchema that describes every input batch.
output_schemaFinal schema and column order requested by the caller.
project_batch_functionOptional implementation returned by ProjectionContext::ResolveProjectBatchFunction, or nullptr to use the nanoarrow path.
Note
It validates that output_schema selects or reorders complete top-level fields by field id. Nested pruning and type changes are rejected. The input_schema and output_schema passed to Make must outlive the context. ProjectBatch may lazily initialize backend cache; do not share one context across concurrent calls.

◆ RegisterProjectBatchFunction()

void iceberg::ProjectionContext::RegisterProjectBatchFunction ( ProjectionContext::ProjectBatchFunction  project_batch_function)
static

Register a custom implementation for ProjectBatch.

Registration is process-wide. If multiple implementations are registered, the last non-null implementation wins.


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