Skip to content

Commit

Permalink
update gar ut & pytest
Browse files Browse the repository at this point in the history
  • Loading branch information
jasinliu committed Sep 19, 2023
1 parent 3089bbf commit c9e7763
Show file tree
Hide file tree
Showing 177 changed files with 725 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/import/import_v3.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class Importer {
std::string db_dir = "./lgraph_db"; // db data dir to use
std::string user = "admin";
std::string password = "73@TuGraph";
bool is_graphar = false; // whether to import Graphar file
bool is_graphar = false; // import Graphar file, config file must be absolute path
std::string graph = "default"; // graph name
bool delete_if_exists = false; // force import, delete data if already exists
bool continue_on_error = false; // whether to continue when there are data errors
Expand Down
1 change: 1 addition & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ add_executable(unit_test
test_import_parse_delimiter.cpp
test_import_planner.cpp
test_import_v2.cpp
test_import_gar.cpp
test_type_convert.cpp
test_json_convert.cpp
test_lgraph.cpp
Expand Down
14 changes: 14 additions & 0 deletions test/integration/test_import_gar.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import pytest
import logging
from pathlib import Path

log = logging.getLogger(__name__)

class TestImportGar:
config_path = Path.cwd().parent.parent / "test/resource/data/ldbc_parquet/ldbc_sample.graph.yml"

IMPORTOPT = {"cmd":f"./lgraph_import -c {config_path} --gar true --overwrite true --d gar_db"}

@pytest.mark.parametrize("importer", [IMPORTOPT], indirect=True)
def test_cpp_client(self, importer):
pass
30 changes: 30 additions & 0 deletions test/resource/data/ldbc/comment.vertex.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
label: comment
chunk_size: 4096
prefix: vertex/comment/
property_groups:
- file_type: parquet
properties:
- name: locationIP
data_type: string
is_primary: false
- file_type: parquet
properties:
- name: browserUsed
data_type: string
is_primary: false
- file_type: parquet
properties:
- name: content
data_type: string
is_primary: false
- file_type: parquet
properties:
- name: length
data_type: int64
is_primary: false
- file_type: parquet
properties:
- name: id
data_type: int64
is_primary: true
version: gar/v1
16 changes: 16 additions & 0 deletions test/resource/data/ldbc/comment_hasCreator_person.edge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
src_label: comment
edge_label: hasCreator
dst_label: person
chunk_size: 8192
src_chunk_size: 4096
dst_chunk_size: 4096
prefix: edge/comment_hasCreator_person/
directed: true
adj_lists:
- ordered: true
aligned_by: dst
file_type: parquet
- ordered: true
aligned_by: src
file_type: parquet
version: gar/v1
16 changes: 16 additions & 0 deletions test/resource/data/ldbc/comment_hasTag_tag.edge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
src_label: comment
edge_label: hasTag
dst_label: tag
chunk_size: 8192
src_chunk_size: 4096
dst_chunk_size: 4096
prefix: edge/comment_hasTag_tag/
directed: true
adj_lists:
- ordered: true
aligned_by: dst
file_type: parquet
- ordered: true
aligned_by: src
file_type: parquet
version: gar/v1
16 changes: 16 additions & 0 deletions test/resource/data/ldbc/comment_isLocatedIn_place.edge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
src_label: comment
edge_label: isLocatedIn
dst_label: place
chunk_size: 8192
src_chunk_size: 4096
dst_chunk_size: 4096
prefix: edge/comment_isLocatedIn_place/
directed: true
adj_lists:
- ordered: true
aligned_by: dst
file_type: parquet
- ordered: true
aligned_by: src
file_type: parquet
version: gar/v1
16 changes: 16 additions & 0 deletions test/resource/data/ldbc/comment_replyOf_comment.edge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
src_label: comment
edge_label: replyOf
dst_label: comment
chunk_size: 8192
src_chunk_size: 4096
dst_chunk_size: 4096
prefix: edge/comment_replyOf_comment/
directed: true
adj_lists:
- ordered: true
aligned_by: dst
file_type: parquet
- ordered: true
aligned_by: src
file_type: parquet
version: gar/v1
16 changes: 16 additions & 0 deletions test/resource/data/ldbc/comment_replyOf_post.edge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
src_label: comment
edge_label: replyOf
dst_label: post
chunk_size: 8192
src_chunk_size: 4096
dst_chunk_size: 4096
prefix: edge/comment_replyOf_post/
directed: true
adj_lists:
- ordered: true
aligned_by: dst
file_type: parquet
- ordered: true
aligned_by: src
file_type: parquet
version: gar/v1
13 changes: 13 additions & 0 deletions test/resource/data/ldbc/forum.vertex.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
label: forum
chunk_size: 4096
prefix: vertex/forum/
property_groups:
- file_type: parquet
properties:
- name: title
data_type: string
is_primary: false
- name: id
data_type: int64
is_primary: true
version: gar/v1
16 changes: 16 additions & 0 deletions test/resource/data/ldbc/forum_containerOf_post.edge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
src_label: forum
edge_label: containerOf
dst_label: post
chunk_size: 8192
src_chunk_size: 4096
dst_chunk_size: 4096
prefix: edge/forum_containerOf_post/
directed: true
adj_lists:
- ordered: true
aligned_by: dst
file_type: parquet
- ordered: true
aligned_by: src
file_type: parquet
version: gar/v1
16 changes: 16 additions & 0 deletions test/resource/data/ldbc/forum_hasMember_person.edge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
src_label: forum
edge_label: hasMember
dst_label: person
chunk_size: 8192
src_chunk_size: 4096
dst_chunk_size: 4096
prefix: edge/forum_hasMember_person/
directed: true
adj_lists:
- ordered: true
aligned_by: dst
file_type: parquet
- ordered: true
aligned_by: src
file_type: parquet
version: gar/v1
16 changes: 16 additions & 0 deletions test/resource/data/ldbc/forum_hasModerator_person.edge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
src_label: forum
edge_label: hasModerator
dst_label: person
chunk_size: 8192
src_chunk_size: 4096
dst_chunk_size: 4096
prefix: edge/forum_hasModerator_person/
directed: true
adj_lists:
- ordered: true
aligned_by: dst
file_type: parquet
- ordered: true
aligned_by: src
file_type: parquet
version: gar/v1
16 changes: 16 additions & 0 deletions test/resource/data/ldbc/forum_hasTag_tag.edge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
src_label: forum
edge_label: hasTag
dst_label: tag
chunk_size: 8192
src_chunk_size: 4096
dst_chunk_size: 4096
prefix: edge/forum_hasTag_tag/
directed: true
adj_lists:
- ordered: true
aligned_by: dst
file_type: parquet
- ordered: true
aligned_by: src
file_type: parquet
version: gar/v1
35 changes: 35 additions & 0 deletions test/resource/data/ldbc/ldbc.graph.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: ldbc
vertices:
- tagclass.vertex.yml
- post.vertex.yml
- comment.vertex.yml
- place.vertex.yml
- tag.vertex.yml
- organisation.vertex.yml
- forum.vertex.yml
- person.vertex.yml
edges:
- tag_hasType_tagclass.edge.yml
- tagclass_isSubclassOf_tagclass.edge.yml
- forum_hasMember_person.edge.yml
- forum_containerOf_post.edge.yml
- forum_hasTag_tag.edge.yml
- comment_hasTag_tag.edge.yml
- place_isPartOf_place.edge.yml
- comment_replyOf_post.edge.yml
- organisation_isLocatedIn_place.edge.yml
- comment_replyOf_comment.edge.yml
- post_hasCreator_person.edge.yml
- comment_isLocatedIn_place.edge.yml
- person_hasInterest_tag.edge.yml
- person_workAt_organisation.edge.yml
- post_isLocatedIn_place.edge.yml
- post_hasTag_tag.edge.yml
- person_studyAt_organisation.edge.yml
- forum_hasModerator_person.edge.yml
- person_likes_post.edge.yml
- person_likes_comment.edge.yml
- comment_hasCreator_person.edge.yml
- person_isLocatedIn_place.edge.yml
- person_knows_person.edge.yml
version: gar/v1
19 changes: 19 additions & 0 deletions test/resource/data/ldbc/organisation.vertex.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
label: organisation
chunk_size: 4096
prefix: vertex/organisation/
property_groups:
- file_type: parquet
properties:
- name: type
data_type: string
is_primary: false
- name: name
data_type: string
is_primary: false
- name: url
data_type: string
is_primary: false
- name: id
data_type: int64
is_primary: true
version: gar/v1
16 changes: 16 additions & 0 deletions test/resource/data/ldbc/organisation_isLocatedIn_place.edge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
src_label: organisation
edge_label: isLocatedIn
dst_label: place
chunk_size: 8192
src_chunk_size: 4096
dst_chunk_size: 4096
prefix: edge/organisation_isLocatedIn_place
directed: true
adj_lists:
- ordered: true
aligned_by: dst
file_type: parquet
- ordered: true
aligned_by: src
file_type: parquet
version: gar/v1
35 changes: 35 additions & 0 deletions test/resource/data/ldbc/person.vertex.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
label: person
chunk_size: 4096
prefix: vertex/person/
property_groups:
- file_type: parquet
properties:
- name: firstName
data_type: string
is_primary: false
- file_type: parquet
properties:
- name: lastName
data_type: string
is_primary: false
- file_type: parquet
properties:
- name: gender
data_type: string
is_primary: false
- file_type: parquet
properties:
- name: locationIP
data_type: string
is_primary: false
- file_type: parquet
properties:
- name: browserUsed
data_type: string
is_primary: false
- file_type: parquet
properties:
- name: id
data_type: int64
is_primary: true
version: gar/v1
16 changes: 16 additions & 0 deletions test/resource/data/ldbc/person_hasInterest_tag.edge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
src_label: person
edge_label: hasInterest
dst_label: tag
chunk_size: 8192
src_chunk_size: 4096
dst_chunk_size: 4096
prefix: edge/person_hasInterest_tag/
directed: true
adj_lists:
- ordered: true
aligned_by: dst
file_type: parquet
- ordered: true
aligned_by: src
file_type: parquet
version: gar/v1
16 changes: 16 additions & 0 deletions test/resource/data/ldbc/person_isLocatedIn_place.edge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
src_label: person
edge_label: isLocatedIn
dst_label: place
chunk_size: 8192
src_chunk_size: 4096
dst_chunk_size: 4096
prefix: edge/person_isLocatedIn_place/
directed: true
adj_lists:
- ordered: true
aligned_by: dst
file_type: parquet
- ordered: true
aligned_by: src
file_type: parquet
version: gar/v1
Loading

0 comments on commit c9e7763

Please sign in to comment.