Apache GraphAr C++ Library
The C++ Library for Apache GraphAr
Public Member Functions | Static Public Member Functions | List of all members
graphar::VertexPropertyArrowChunkReader Class Reference

The arrow chunk reader for vertex property group. More...

#include <chunk_reader.h>

Public Member Functions

 VertexPropertyArrowChunkReader (const std::shared_ptr< VertexInfo > &vertex_info, const std::shared_ptr< PropertyGroup > &property_group, const std::string &prefix, const util::FilterOptions &options={})
 Initialize the VertexPropertyArrowChunkReader. More...
 
Status seek (IdType id)
 Sets chunk position indicator for reader by internal vertex id. If internal vertex id is not found, will return Status::IndexError error. After seeking to an invalid vertex id, the next call to GetChunk function may undefined, e.g. return an non exist path. More...
 
Result< std::shared_ptr< arrow::Table > > GetChunk ()
 Return the current arrow chunk table of chunk position indicator.
 
Status next_chunk ()
 Sets chunk position indicator to next chunk. More...
 
IdType GetChunkNum () const noexcept
 Get the chunk number of current vertex property group.
 
void Filter (util::Filter filter=nullptr)
 Apply the row filter to the table. No parameter call Filter() will clear the filter. More...
 
void Select (util::ColumnNames column_names=std::nullopt)
 Apply the projection to the table to be read. No parameter call Select() will clear the projection. More...
 

Static Public Member Functions

static Result< std::shared_ptr< VertexPropertyArrowChunkReader > > Make (const std::shared_ptr< VertexInfo > &vertex_info, const std::shared_ptr< PropertyGroup > &property_group, const std::string &prefix, const util::FilterOptions &options={})
 Create a VertexPropertyArrowChunkReader instance from vertex info. More...
 
static Result< std::shared_ptr< VertexPropertyArrowChunkReader > > Make (const std::shared_ptr< GraphInfo > &graph_info, const std::string &label, const std::shared_ptr< PropertyGroup > &property_group, const util::FilterOptions &options={})
 Create a VertexPropertyArrowChunkReader instance from graph info and property group. More...
 
static Result< std::shared_ptr< VertexPropertyArrowChunkReader > > Make (const std::shared_ptr< GraphInfo > &graph_info, const std::string &label, const std::string &property_name, const util::FilterOptions &options={})
 Create a VertexPropertyArrowChunkReader instance from graph info and property name. More...
 

Detailed Description

The arrow chunk reader for vertex property group.

Definition at line 42 of file chunk_reader.h.

Constructor & Destructor Documentation

◆ VertexPropertyArrowChunkReader()

graphar::VertexPropertyArrowChunkReader::VertexPropertyArrowChunkReader ( const std::shared_ptr< VertexInfo > &  vertex_info,
const std::shared_ptr< PropertyGroup > &  property_group,
const std::string &  prefix,
const util::FilterOptions options = {} 
)

Initialize the VertexPropertyArrowChunkReader.

Parameters
vertex_infoThe vertex info that describes the vertex type.
property_groupThe property group that describes the property group.
prefixThe absolute prefix.

Definition at line 128 of file chunk_reader.cc.

Member Function Documentation

◆ Filter()

void graphar::VertexPropertyArrowChunkReader::Filter ( util::Filter  filter = nullptr)

Apply the row filter to the table. No parameter call Filter() will clear the filter.

Parameters
filterPredicate expression to filter rows.

Definition at line 201 of file chunk_reader.cc.

◆ Make() [1/3]

Result< std::shared_ptr< VertexPropertyArrowChunkReader > > graphar::VertexPropertyArrowChunkReader::Make ( const std::shared_ptr< GraphInfo > &  graph_info,
const std::string &  label,
const std::shared_ptr< PropertyGroup > &  property_group,
const util::FilterOptions options = {} 
)
static

Create a VertexPropertyArrowChunkReader instance from graph info and property group.

Parameters
graph_infoThe graph info.
labelThe vertex label.
property_groupThe property group of the vertex property.
optionsThe filter options, default is empty.

Definition at line 219 of file chunk_reader.cc.

◆ Make() [2/3]

Result< std::shared_ptr< VertexPropertyArrowChunkReader > > graphar::VertexPropertyArrowChunkReader::Make ( const std::shared_ptr< GraphInfo > &  graph_info,
const std::string &  label,
const std::string &  property_name,
const util::FilterOptions options = {} 
)
static

Create a VertexPropertyArrowChunkReader instance from graph info and property name.

Parameters
graph_infoThe graph info.
labelThe vertex label.
property_nameThe name of one property in the property group you want to read.
optionsThe filter options, default is empty.

Definition at line 233 of file chunk_reader.cc.

◆ Make() [3/3]

Result< std::shared_ptr< VertexPropertyArrowChunkReader > > graphar::VertexPropertyArrowChunkReader::Make ( const std::shared_ptr< VertexInfo > &  vertex_info,
const std::shared_ptr< PropertyGroup > &  property_group,
const std::string &  prefix,
const util::FilterOptions options = {} 
)
static

Create a VertexPropertyArrowChunkReader instance from vertex info.

Parameters
vertex_infoThe vertex info.
property_groupThe property group of the vertex property.
prefixThe absolute prefix of the graph.
optionsThe filter options, default is empty.

Definition at line 210 of file chunk_reader.cc.

◆ next_chunk()

Status graphar::VertexPropertyArrowChunkReader::next_chunk ( )

Sets chunk position indicator to next chunk.

if current chunk is the last chunk, will return Status::IndexError error.

Definition at line 189 of file chunk_reader.cc.

◆ seek()

Status graphar::VertexPropertyArrowChunkReader::seek ( IdType  id)

Sets chunk position indicator for reader by internal vertex id. If internal vertex id is not found, will return Status::IndexError error. After seeking to an invalid vertex id, the next call to GetChunk function may undefined, e.g. return an non exist path.

Parameters
idthe vertex id.

Definition at line 151 of file chunk_reader.cc.

◆ Select()

void graphar::VertexPropertyArrowChunkReader::Select ( util::ColumnNames  column_names = std::nullopt)

Apply the projection to the table to be read. No parameter call Select() will clear the projection.

Parameters
column_namesThe name of columns to be selected.

Definition at line 205 of file chunk_reader.cc.


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