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...
 
 VertexPropertyArrowChunkReader (const std::shared_ptr< VertexInfo > &vertex_info, const std::shared_ptr< PropertyGroup > &property_group, const std::vector< std::string > &property_names, const std::string &prefix, const util::FilterOptions &options={})
 Initialize the VertexPropertyArrowChunkReader. More...
 
 VertexPropertyArrowChunkReader (const std::shared_ptr< VertexInfo > &vertex_info, const std::vector< std::string > &labels, 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 (GetChunkVersion version=GetChunkVersion::AUTO)
 Return the current arrow chunk table of chunk position indicator.
 
Result< std::shared_ptr< arrow::Table > > GetLabelChunk ()
 Return the current arrow label 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< VertexInfo > &vertex_info, const std::shared_ptr< PropertyGroup > &property_group, const std::vector< std::string > &property_names, 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 &type, 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 &type, const std::string &property_name, const util::FilterOptions &options={})
 Create a VertexPropertyArrowChunkReader instance from graph info and property name. More...
 
static Result< std::shared_ptr< VertexPropertyArrowChunkReader > > Make (const std::shared_ptr< GraphInfo > &graph_info, const std::string &type, const std::vector< std::string > &property_names_or_labels, const SelectType select_type, const util::FilterOptions &options={})
 Create a VertexPropertyArrowChunkReader instance from vertex info for labels. More...
 
static Result< std::shared_ptr< VertexPropertyArrowChunkReader > > Make (const std::shared_ptr< VertexInfo > &vertex_info, const std::vector< std::string > &labels, const std::string &prefix, const util::FilterOptions &options={})
 Create a VertexPropertyArrowChunkReader instance from vertex info for labels. More...
 
static Result< std::shared_ptr< VertexPropertyArrowChunkReader > > MakeForProperties (const std::shared_ptr< GraphInfo > &graph_info, const std::string &type, const std::vector< std::string > &property_names, const util::FilterOptions &options={})
 Create a VertexPropertyArrowChunkReader instance from graph info for properties. More...
 
static Result< std::shared_ptr< VertexPropertyArrowChunkReader > > MakeForLabels (const std::shared_ptr< GraphInfo > &graph_info, const std::string &type, const std::vector< std::string > &labels, const util::FilterOptions &options={})
 Create a VertexPropertyArrowChunkReader instance from graph info for labels. More...
 

Detailed Description

The arrow chunk reader for vertex property group.

Definition at line 43 of file chunk_reader.h.

Constructor & Destructor Documentation

◆ VertexPropertyArrowChunkReader() [1/3]

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 154 of file chunk_reader.cc.

◆ VertexPropertyArrowChunkReader() [2/3]

graphar::VertexPropertyArrowChunkReader::VertexPropertyArrowChunkReader ( const std::shared_ptr< VertexInfo > &  vertex_info,
const std::shared_ptr< PropertyGroup > &  property_group,
const std::vector< std::string > &  property_names,
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.
property_namesOnly these properties will be read.
prefixThe absolute prefix.

Definition at line 161 of file chunk_reader.cc.

◆ VertexPropertyArrowChunkReader() [3/3]

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

Initialize the VertexPropertyArrowChunkReader.

Parameters
vertex_infoThe vertex info that describes the vertex type.
labelsThe labels of the vertex type.
prefixThe absolute prefix.

Definition at line 187 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 360 of file chunk_reader.cc.

◆ Make() [1/6]

Result< std::shared_ptr< VertexPropertyArrowChunkReader > > graphar::VertexPropertyArrowChunkReader::Make ( const std::shared_ptr< GraphInfo > &  graph_info,
const std::string &  type,
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.
typeThe vertex type.
property_groupThe property group of the vertex property.
optionsThe filter options, default is empty.

Definition at line 388 of file chunk_reader.cc.

◆ Make() [2/6]

Result< std::shared_ptr< VertexPropertyArrowChunkReader > > graphar::VertexPropertyArrowChunkReader::Make ( const std::shared_ptr< GraphInfo > &  graph_info,
const std::string &  type,
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.
typeThe vertex type.
property_nameThe name of one property in the property group you want to read.
optionsThe filter options, default is empty.

Definition at line 402 of file chunk_reader.cc.

◆ Make() [3/6]

Result< std::shared_ptr< VertexPropertyArrowChunkReader > > graphar::VertexPropertyArrowChunkReader::Make ( const std::shared_ptr< GraphInfo > &  graph_info,
const std::string &  type,
const std::vector< std::string > &  property_names_or_labels,
const SelectType  select_type,
const util::FilterOptions options = {} 
)
static

Create a VertexPropertyArrowChunkReader instance from vertex info for labels.

Parameters
vertex_infoThe vertex info.
labelsThe name of labels you want to read.
select_typeThe select type, properties or labels.
prefixThe absolute prefix of the graph.
optionsThe filter options, default is empty.

Definition at line 426 of file chunk_reader.cc.

◆ Make() [4/6]

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 369 of file chunk_reader.cc.

◆ Make() [5/6]

Result< std::shared_ptr< VertexPropertyArrowChunkReader > > graphar::VertexPropertyArrowChunkReader::Make ( const std::shared_ptr< VertexInfo > &  vertex_info,
const std::shared_ptr< PropertyGroup > &  property_group,
const std::vector< std::string > &  property_names,
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.
property_namesis not empty, only these properties will be read.
prefixThe absolute prefix of the graph.
optionsThe filter options, default is empty.

Definition at line 378 of file chunk_reader.cc.

◆ Make() [6/6]

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

Create a VertexPropertyArrowChunkReader instance from vertex info for labels.

Parameters
vertex_infoThe vertex info.
labelsThe name of labels you want to read.
prefixThe absolute prefix of the graph.
optionsThe filter options, default is empty.

Definition at line 494 of file chunk_reader.cc.

◆ MakeForLabels()

Result< std::shared_ptr< VertexPropertyArrowChunkReader > > graphar::VertexPropertyArrowChunkReader::MakeForLabels ( const std::shared_ptr< GraphInfo > &  graph_info,
const std::string &  type,
const std::vector< std::string > &  labels,
const util::FilterOptions options = {} 
)
static

Create a VertexPropertyArrowChunkReader instance from graph info for labels.

Parameters
graph_infoThe graph info.
typeThe vertex type.
labelsThe name of labels you want to read.
prefixThe absolute prefix of the graph.
optionsThe filter options, default is empty.

Definition at line 503 of file chunk_reader.cc.

◆ MakeForProperties()

Result< std::shared_ptr< VertexPropertyArrowChunkReader > > graphar::VertexPropertyArrowChunkReader::MakeForProperties ( const std::shared_ptr< GraphInfo > &  graph_info,
const std::string &  type,
const std::vector< std::string > &  property_names,
const util::FilterOptions options = {} 
)
static

Create a VertexPropertyArrowChunkReader instance from graph info for properties.

Parameters
graph_infoThe graph info.
typeThe vertex type.
property_namesThe name of properties you want to read.
prefixThe absolute prefix of the graph.
optionsThe filter options, default is empty.

Definition at line 440 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 348 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 209 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 364 of file chunk_reader.cc.


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