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

Reads the record batch file format. More...

#include <arrow/ipc/reader.h>

Public Member Functions

 ~RecordBatchFileReader ()
 
std::shared_ptr< Schemaschema () const
 The schema read from the file. More...
 
int num_record_batches () const
 Returns the number of record batches in the file. More...
 
MetadataVersion version () const
 Return the metadata version from the file metadata. More...
 
Status ReadRecordBatch (int i, std::shared_ptr< RecordBatch > *batch)
 Read a particular record batch from the file. More...
 

Static Public Member Functions

static Status Open (io::RandomAccessFile *file, std::shared_ptr< RecordBatchFileReader > *reader)
 Open a RecordBatchFileReader. More...
 
static Status Open (io::RandomAccessFile *file, int64_t footer_offset, std::shared_ptr< RecordBatchFileReader > *reader)
 Open a RecordBatchFileReader If the file is embedded within some larger file or memory region, you can pass the absolute memory offset to the end of the file (which contains the metadata footer). More...
 
static Status Open (const std::shared_ptr< io::RandomAccessFile > &file, std::shared_ptr< RecordBatchFileReader > *reader)
 Version of Open that retains ownership of file. More...
 
static Status Open (const std::shared_ptr< io::RandomAccessFile > &file, int64_t footer_offset, std::shared_ptr< RecordBatchFileReader > *reader)
 Version of Open that retains ownership of file. More...
 

Detailed Description

Reads the record batch file format.

Constructor & Destructor Documentation

◆ ~RecordBatchFileReader()

arrow::ipc::RecordBatchFileReader::~RecordBatchFileReader ( )

Member Function Documentation

◆ num_record_batches()

int arrow::ipc::RecordBatchFileReader::num_record_batches ( ) const

Returns the number of record batches in the file.

◆ Open() [1/4]

static Status arrow::ipc::RecordBatchFileReader::Open ( io::RandomAccessFile file,
std::shared_ptr< RecordBatchFileReader > *  reader 
)
static

Open a RecordBatchFileReader.

Open a file-like object that is assumed to be self-contained; i.e., the end of the file interface is the end of the Arrow file. Note that there can be any amount of data preceding the Arrow-formatted data, because we need only locate the end of the Arrow file stream to discover the metadata and then proceed to read the data into memory.

◆ Open() [2/4]

static Status arrow::ipc::RecordBatchFileReader::Open ( io::RandomAccessFile file,
int64_t  footer_offset,
std::shared_ptr< RecordBatchFileReader > *  reader 
)
static

Open a RecordBatchFileReader If the file is embedded within some larger file or memory region, you can pass the absolute memory offset to the end of the file (which contains the metadata footer).

The metadata must have been written with memory offsets relative to the start of the containing file

Parameters
[in]filethe data source
[in]footer_offsetthe position of the end of the Arrow file
[out]readerthe returned reader
Returns
Status

◆ Open() [3/4]

static Status arrow::ipc::RecordBatchFileReader::Open ( const std::shared_ptr< io::RandomAccessFile > &  file,
std::shared_ptr< RecordBatchFileReader > *  reader 
)
static

Version of Open that retains ownership of file.

Parameters
[in]filethe data source
[out]readerthe returned reader
Returns
Status

◆ Open() [4/4]

static Status arrow::ipc::RecordBatchFileReader::Open ( const std::shared_ptr< io::RandomAccessFile > &  file,
int64_t  footer_offset,
std::shared_ptr< RecordBatchFileReader > *  reader 
)
static

Version of Open that retains ownership of file.

Parameters
[in]filethe data source
[in]footer_offsetthe position of the end of the Arrow file
[out]readerthe returned reader
Returns
Status

◆ ReadRecordBatch()

Status arrow::ipc::RecordBatchFileReader::ReadRecordBatch ( int  i,
std::shared_ptr< RecordBatch > *  batch 
)

Read a particular record batch from the file.

Does not copy memory if the input source supports zero-copy.

Parameters
[in]ithe index of the record batch to return
[out]batchthe read batch
Returns
Status

◆ schema()

std::shared_ptr<Schema> arrow::ipc::RecordBatchFileReader::schema ( ) const

The schema read from the file.

◆ version()

MetadataVersion arrow::ipc::RecordBatchFileReader::version ( ) const

Return the metadata version from the file metadata.


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