Apache GraphAr C++ Library
The C++ Library for Apache GraphAr
|
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... | |
The arrow chunk reader for vertex property group.
Definition at line 42 of file chunk_reader.h.
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.
vertex_info | The vertex info that describes the vertex type. |
property_group | The property group that describes the property group. |
prefix | The absolute prefix. |
Definition at line 128 of file chunk_reader.cc.
void graphar::VertexPropertyArrowChunkReader::Filter | ( | util::Filter | filter = nullptr | ) |
Apply the row filter to the table. No parameter call Filter() will clear the filter.
filter | Predicate expression to filter rows. |
Definition at line 201 of file chunk_reader.cc.
|
static |
Create a VertexPropertyArrowChunkReader instance from graph info and property group.
graph_info | The graph info. |
label | The vertex label. |
property_group | The property group of the vertex property. |
options | The filter options, default is empty. |
Definition at line 219 of file chunk_reader.cc.
|
static |
Create a VertexPropertyArrowChunkReader instance from graph info and property name.
graph_info | The graph info. |
label | The vertex label. |
property_name | The name of one property in the property group you want to read. |
options | The filter options, default is empty. |
Definition at line 233 of file chunk_reader.cc.
|
static |
Create a VertexPropertyArrowChunkReader instance from vertex info.
vertex_info | The vertex info. |
property_group | The property group of the vertex property. |
prefix | The absolute prefix of the graph. |
options | The filter options, default is empty. |
Definition at line 210 of file chunk_reader.cc.
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.
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.
id | the vertex id. |
Definition at line 151 of file chunk_reader.cc.
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.
column_names | The name of columns to be selected. |
Definition at line 205 of file chunk_reader.cc.