apache / apache/incubator-graphar

[C++] [Improvement] Support to write std::vector in VerticesBuilder/EdgeBuilder of the C++ library

Open
#167 1 comment 0 reactions 0 assignees View on GitHub
Component:C++ enhancement good first issue
Dominant language
C++
Stars
373
Forks
93
Avg merge
7d 21h
Merged PRs (30d)
7

Description

**Is your feature request related to a problem? Please describe.**
As the first step of issue #48, we propose to add new methods in the writers of the GraphAr C++ library to support the use of `std::vector` as an input parameter and write the data to generate GraphAr data files.

**Describe the solution you'd like**
To extend the high-level writer of the C++ library, i.e. [VerticesBuilder](https://alibaba.github.io/GraphAr/reference/api-reference-cpp.html#_CPPv4N12GraphArchive7builder15VerticesBuilderE) and [EdgesBuilder](https://alibaba.github.io/GraphAr/reference/api-reference-cpp.html#_CPPv4N12GraphArchive7builder12EdgesBuilderE), we recommend to implement the following function, for adding a column of a property:

```
class VerticesBuilder/EdgesBuilder {
...
Status AddPropertyColumn(const std::string &property, const std::vector &values);
...
}
```
For implementation, the `values` can be added in `Vertices` of the builder one by one, or it can be saved separately and processed when `Dump()` is called.

**Describe alternatives you've considered**
As the next step, we suggest modifying the low-level writers of the C++ library to support writing `std::vector`.

**Additional context**
This issue is a part of issue #48 and is a good first issue for beginners to get familiar with our C++ library.

Contributor guide

Open the contributing guide

Research direction

Start by locating the C++ VerticesBuilder and EdgesBuilder implementations and read how existing property columns are added and how Dump() processes them. Implement the requested vector-based property-column entry point for both builders, then verify that vector values are written into valid GraphAr data files through the existing C++ writer workflow.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
backend-api-design, data-engineering
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
64/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.