Skip to content

refactor(interactive): Support complex graph schema #4538

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

zhanglei1949
Copy link
Collaborator

@zhanglei1949 zhanglei1949 commented Feb 27, 2025

Previously we only allow less than 256 labels for vertices and edges in Interactive. In this PR, we make label_t customizable when building. And we introduce a test case to test interactive on a graph with 1000 vertex labels and 1000 edge labels.

  1. Previously we used bit manipulation to construct a unique edge label from <src_label, dst_label, edge_label> triplet. This method doesn't work if the number of labels is larger than 256. To resolve this, we introduce a hashmap in schema.h to maintain the projection from the label triplet to the unique edge_triplet_id
  std::vector<std::tuple<label_t, label_t, label_t>> e_triplet_labels_;
  std::unordered_map<std::tuple<label_t, label_t, label_t>, uint32_t,
                     boost::hash<std::tuple<label_t, label_t, label_t>>>
      e_triplet_to_index_;
  1. Add a CI.
  2. Refactor the code related

…e labels

Committed-by: [email protected] from Dev container

Committed-by: [email protected] from Dev container
edge_label_num_ = graph.schema().edge_label_num();
vertex_label_num_ = graph.schema().vertex_label_num();
indexs.resize(2 * vertex_label_num_ * vertex_label_num_ * edge_label_num_,
Copy link
Collaborator Author

@zhanglei1949 zhanglei1949 Feb 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems no need to resize to 2* csr_num? @liulx20

@@ -88,8 +92,7 @@ class Schema {
const std::vector<std::tuple<PropertyType, std::string, size_t>>&
primary_key,
const std::vector<StorageStrategy>& strategies = {},
size_t max_vnum = static_cast<size_t>(1) << 32,
const std::string& description = "");
size_t max_vnum = DEFAULT_MAX_VNUM, const std::string& description = "");
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

previous 2^32 is two large when we have many kind of vertices. @liulx20

Committed-by: xiaolei.zl from Dev container
@codecov-commenter
Copy link

codecov-commenter commented Feb 28, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 44.76%. Comparing base (aae2c37) to head (9722fe4).
Report is 9 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4538      +/-   ##
==========================================
+ Coverage   35.01%   44.76%   +9.74%     
==========================================
  Files         127       12     -115     
  Lines       13299      592   -12707     
==========================================
- Hits         4657      265    -4392     
+ Misses       8642      327    -8315     

see 115 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update aae2c37...9722fe4. Read the comment docs.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Committed-by: xiaolei.zl from Dev container
@zhanglei1949 zhanglei1949 requested review from liulx20 and luoxiaojian and removed request for liulx20 March 3, 2025 07:44
Committed-by: xiaolei.zl from Dev container
@zhanglei1949 zhanglei1949 requested a review from liulx20 March 3, 2025 07:48
Copy link
Contributor

github-actions bot commented Mar 3, 2025

Please check the preview of the documentation changes at
https://0b20feab.graphscope-docs-preview.pages.dev

Committed-by: xiaolei.zl from Dev container
Committed-by: xiaolei.zl from Dev container
Committed-by: xiaolei.zl from Dev container
Committed-by: xiaolei.zl from Dev container
Committed-by: xiaolei.zl from Dev container
Committed-by: xiaolei.zl from Dev container
Committed-by: xiaolei.zl from Dev container
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants