iceberg-cpp
Loading...
Searching...
No Matches
Classes | Functions
metadata_column_util_internal.h File Reference
#include <cstdint>
#include <memory>
#include <string>
#include <arrow/type_fwd.h>
#include "iceberg/result.h"

Go to the source code of this file.

Classes

struct  iceberg::arrow::MetadataColumnContext
 Context for populating metadata columns during reading. More...
 

Functions

Result< std::shared_ptr<::arrow::Array > > iceberg::arrow::MakeFilePathArray (const std::string &file_path, int64_t num_rows, ::arrow::MemoryPool *pool)
 Create a constant string array for _file column.
 
Result< std::shared_ptr<::arrow::Array > > iceberg::arrow::MakeRowPositionArray (int64_t start_position, int64_t num_rows, ::arrow::MemoryPool *pool)
 Create a sequential int64 array for _pos column.
 

Detailed Description

Utility functions for populating metadata columns (_file and _pos) in readers.

Function Documentation

◆ MakeFilePathArray()

Result< std::shared_ptr<::arrow::Array > > iceberg::arrow::MakeFilePathArray ( const std::string &  file_path,
int64_t  num_rows,
::arrow::MemoryPool *  pool 
)

Create a constant string array for _file column.

Creates an Arrow StringArray where all values are the same file path string.

Parameters
file_pathThe file path value.
num_rowsNumber of rows in the batch.
poolArrow memory pool.
Returns
Arrow StringArray with constant file_path value.

◆ MakeRowPositionArray()

Result< std::shared_ptr<::arrow::Array > > iceberg::arrow::MakeRowPositionArray ( int64_t  start_position,
int64_t  num_rows,
::arrow::MemoryPool *  pool 
)

Create a sequential int64 array for _pos column.

Creates an Arrow Int64Array with sequential values starting from start_position.

Parameters
start_positionStarting row position (inclusive).
num_rowsNumber of rows in the batch.
poolArrow memory pool.
Returns
Arrow Int64Array with values [start_position, start_position + num_rows).