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

The arrow chunk reader for edge property group chunks. More...

#include <chunk_reader.h>

Public Types

using range_t = std::pair< IdType, IdType >
 

Public Member Functions

 AdjListPropertyArrowChunkReader (const std::shared_ptr< EdgeInfo > &edge_info, const std::shared_ptr< PropertyGroup > &property_group, AdjListType adj_list_type, const std::string prefix, const util::FilterOptions &options={})
 Initialize the AdjListPropertyArrowChunkReader. More...
 
 AdjListPropertyArrowChunkReader (const AdjListPropertyArrowChunkReader &other)
 Copy constructor.
 
Status seek_src (IdType id)
 Sets chunk position indicator for reader by source vertex id. More...
 
Status seek_dst (IdType id)
 Sets chunk position indicator for reader by destination vertex id. More...
 
Status seek (IdType offset)
 Sets chunk position indicator for reader by edge index. More...
 
Result< std::shared_ptr< arrow::Table > > GetChunk ()
 Return the current chunk of chunk position indicator as arrow::Table, if the chunk is empty, return nullptr.
 
Status next_chunk ()
 Sets chunk position indicator to next chunk. More...
 
Status seek_chunk_index (IdType vertex_chunk_index, IdType chunk_index=0)
 Sets chunk position to the specific vertex chunk and edge chunk. More...
 
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< AdjListPropertyArrowChunkReader > > Make (const std::shared_ptr< EdgeInfo > &edge_info, const std::shared_ptr< PropertyGroup > &property_group, AdjListType adj_list_type, const std::string &prefix, const util::FilterOptions &options={})
 Create an AdjListPropertyArrowChunkReader instance from edge info. More...
 
static Result< std::shared_ptr< AdjListPropertyArrowChunkReader > > Make (const std::shared_ptr< GraphInfo > &graph_info, const std::string &src_label, const std::string &edge_label, const std::string &dst_label, const std::shared_ptr< PropertyGroup > &property_group, AdjListType adj_list_type, const util::FilterOptions &options={})
 Create an AdjListPropertyArrowChunkReader instance from graph info and property group. More...
 
static Result< std::shared_ptr< AdjListPropertyArrowChunkReader > > Make (const std::shared_ptr< GraphInfo > &graph_info, const std::string &src_label, const std::string &edge_label, const std::string &dst_label, const std::string &property_name, AdjListType adj_list_type, const util::FilterOptions &options={})
 Create an AdjListPropertyArrowChunkReader instance from graph info and property name. More...
 

Detailed Description

The arrow chunk reader for edge property group chunks.

Definition at line 355 of file chunk_reader.h.

Constructor & Destructor Documentation

◆ AdjListPropertyArrowChunkReader()

graphar::AdjListPropertyArrowChunkReader::AdjListPropertyArrowChunkReader ( const std::shared_ptr< EdgeInfo > &  edge_info,
const std::shared_ptr< PropertyGroup > &  property_group,
AdjListType  adj_list_type,
const std::string  prefix,
const util::FilterOptions options = {} 
)

Initialize the AdjListPropertyArrowChunkReader.

Parameters
edge_infoThe edge info that describes the edge type.
property_groupThe property group that describes the property group.
adj_list_typeThe adj list type for the edges.
prefixThe absolute prefix.

Definition at line 569 of file chunk_reader.cc.

Member Function Documentation

◆ Filter()

void graphar::AdjListPropertyArrowChunkReader::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 765 of file chunk_reader.cc.

◆ Make() [1/3]

Result< std::shared_ptr< AdjListPropertyArrowChunkReader > > graphar::AdjListPropertyArrowChunkReader::Make ( const std::shared_ptr< EdgeInfo > &  edge_info,
const std::shared_ptr< PropertyGroup > &  property_group,
AdjListType  adj_list_type,
const std::string &  prefix,
const util::FilterOptions options = {} 
)
static

Create an AdjListPropertyArrowChunkReader instance from edge info.

Parameters
edge_infoThe edge info that describes the edge type.
property_groupThe property group that describes the property
adj_list_typeThe adj list type for the edges.
prefixThe absolute prefix of the graph.
optionsThe filter options, default is empty.

Definition at line 774 of file chunk_reader.cc.

◆ Make() [2/3]

Result< std::shared_ptr< AdjListPropertyArrowChunkReader > > graphar::AdjListPropertyArrowChunkReader::Make ( const std::shared_ptr< GraphInfo > &  graph_info,
const std::string &  src_label,
const std::string &  edge_label,
const std::string &  dst_label,
const std::shared_ptr< PropertyGroup > &  property_group,
AdjListType  adj_list_type,
const util::FilterOptions options = {} 
)
static

Create an AdjListPropertyArrowChunkReader instance from graph info and property group.

Parameters
graph_infoThe graph info that describes the graph.
src_labelThe source vertex label.
edge_labelThe edge label.
dst_labelThe destination vertex label.
property_groupThe property group that describes the property group.
adj_list_typeThe adj list type for the edges.
optionsThe filter options, default is empty.

Definition at line 789 of file chunk_reader.cc.

◆ Make() [3/3]

Result< std::shared_ptr< AdjListPropertyArrowChunkReader > > graphar::AdjListPropertyArrowChunkReader::Make ( const std::shared_ptr< GraphInfo > &  graph_info,
const std::string &  src_label,
const std::string &  edge_label,
const std::string &  dst_label,
const std::string &  property_name,
AdjListType  adj_list_type,
const util::FilterOptions options = {} 
)
static

Create an AdjListPropertyArrowChunkReader instance from graph info and property name.

Parameters
graph_infoThe graph info that describes the graph.
src_labelThe source vertex label.
edge_labelThe edge label.
dst_labelThe destination vertex label.
property_nameThe name of one property in the property group you want to read.
adj_list_typeThe adj list type for the edges.
optionsThe filter options, default is empty.

Definition at line 804 of file chunk_reader.cc.

◆ next_chunk()

Status graphar::AdjListPropertyArrowChunkReader::next_chunk ( )

Sets chunk position indicator to next chunk.

Returns
Status: ok or EndOfChunk error if the reader is at the end of current vertex chunk, or IndexError error if the reader is at the end of all vertex chunks.

Definition at line 726 of file chunk_reader.cc.

◆ seek()

Status graphar::AdjListPropertyArrowChunkReader::seek ( IdType  offset)

Sets chunk position indicator for reader by edge index.

Parameters
offsetedge index of the vertex chunk. Note: the offset is the edge index of the vertex chunk, not the edge index of the whole graph.

Definition at line 677 of file chunk_reader.cc.

◆ seek_chunk_index()

Status graphar::AdjListPropertyArrowChunkReader::seek_chunk_index ( IdType  vertex_chunk_index,
IdType  chunk_index = 0 
)

Sets chunk position to the specific vertex chunk and edge chunk.

Parameters
vertex_chunk_indexthe vertex chunk index.
chunk_indexthe edge chunk index of vertex_chunk_index.
Returns
Status: ok or error

Definition at line 750 of file chunk_reader.cc.

◆ seek_dst()

Status graphar::AdjListPropertyArrowChunkReader::seek_dst ( IdType  id)

Sets chunk position indicator for reader by destination vertex id.

Parameters
idthe destination vertex id.

Definition at line 646 of file chunk_reader.cc.

◆ seek_src()

Status graphar::AdjListPropertyArrowChunkReader::seek_src ( IdType  id)

Sets chunk position indicator for reader by source vertex id.

Parameters
idthe source vertex id.

Definition at line 614 of file chunk_reader.cc.

◆ Select()

void graphar::AdjListPropertyArrowChunkReader::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 769 of file chunk_reader.cc.


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