-
Notifications
You must be signed in to change notification settings - Fork 11
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
TigerGraph implementation #37
Open
YipingXiongTG
wants to merge
10
commits into
ldbc:main
Choose a base branch
from
YipingXiongTG:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
51a7b5a
TigerGraph Impl
c419f2f
modify README.md
18c6203
modify properties file
22ce467
modify trw2.gsql
64ac6b3
using db connection pool instead of reuse one connection
YongchaoLiuTG 865f714
Merge branch 'main' of github.com:YipingXiongTG/ldbc_finbench_transac…
YongchaoLiuTG 7e2149b
fix typo in tcr1
YongchaoLiuTG b467b14
fix tcr1 typo, should use graph
YongchaoLiuTG 5f3082c
fix tcr1 typo again
YongchaoLiuTG f75c858
drop redundant udf
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
# TigerGraph LDBC Financial Implemention | ||
|
||
- [1. Preparation](#1-preparation) | ||
- [1.1 Install TigerGraph](#11-install-tigergraph) | ||
- [1.2 Download & Install Dependencies](#12-download--install-dependencies) | ||
- [2. DDL & Loading & Queries](#2-ddl--loading--queries) | ||
- [2.1 Create schema and loading job](#21-create-schema-and-loading-job) | ||
- [2.2 Load data](#22-load-data) | ||
- [2.2.1 Data directory structure](#221-data-directory-structure) | ||
- [2.2.2 Data Loading](#222-data-loading) | ||
- [2.3 Create and install queries](#23-create-and-install-queries) | ||
- [2.4 One-step setup](#24-one-step-setup) | ||
- [3. Validate](#3-validate) | ||
- [3.1 Create validation](#31-create-validation) | ||
- [3.2 Validate](#32-validate) | ||
|
||
--- | ||
|
||
## 1. Preparation | ||
|
||
Before using the project, follow these steps to prepare your environment. | ||
|
||
### 1.1 Install TigerGraph | ||
|
||
For detailed installation instructions, please refer to the official documentation: [TigerGraph Getting Started Guide](https://docs.tigergraph.com/tigergraph-server/current/getting-started/linux) | ||
|
||
### 1.2 Download & Install Dependencies | ||
|
||
To install the project dependencies, perform the following actions: | ||
|
||
```bash | ||
cd ~ | ||
git clone https://github.com/ldbc/ldbc_finbench_transaction_impls.git | ||
cd ~/ldbc_finbench_transaction_impls | ||
mvn clean package | ||
``` | ||
|
||
## 2. DDL & Loading & Queries | ||
Ensure that you have already installed TigerGraph and authenticated as a user with the necessary privileges to run TigerGraph. | ||
### 2.1 Create schema and loading job | ||
```bash | ||
bash ~/ldbc_finbench_transaction_impls/tigergraph/scripts/setup_schema.sh | ||
``` | ||
|
||
### 2.2 load data | ||
#### 2.2.1 Data directory structure | ||
```bash | ||
$ tree -L 2 ~/ldbc_finbench_transaction_impls/tigergraph/data | ||
├── sf1 | ||
│ ├── deletes | ||
│ ├── incremental | ||
│ ├── inserts | ||
│ ├── raw | ||
│ ├── read_params | ||
│ └── snapshot | ||
└── sf10 | ||
├── incremental | ||
├── raw | ||
├── read_params | ||
└── snapshot | ||
... | ||
``` | ||
|
||
#### 2.2.2 Data Loading | ||
```bash | ||
bash ~/ldbc_finbench_transaction_impls/tigergraph/scripts/load_data.sh | ||
``` | ||
|
||
### 2.3 Create and install queries | ||
```bash | ||
bash ~/ldbc_finbench_transaction_impls/tigergraph/scripts/create_queries.sh | ||
bash ~/ldbc_finbench_transaction_impls/tigergraph/scripts/install_queries.sh | ||
``` | ||
|
||
### 2.4 one-step setup | ||
If you prefer to avoid separately performing steps 2.1, 2.2, and 2.3, you can use the convenient ```one_step_env.sh``` script, which automates the setup process of creating schemas, loading data, and preparing queries. | ||
```bash | ||
bash ~/ldbc_finbench_transaction_impls/tigergraph/scripts/one_step_env.sh | ||
``` | ||
|
||
## 3. Validate | ||
### 3.1 Create validation | ||
```shell | ||
cd ~/ldbc_finbench_transaction_impls/tigergraph | ||
bash run.sh create_validation.properties | ||
``` | ||
|
||
### 3.2 Validate | ||
```shell | ||
cd ~/ldbc_finbench_transaction_impls/tigergraph | ||
bash run.sh validate_database.properties | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
############################################################ | ||
# SUT defined configurations # | ||
############################################################ | ||
ipAddr=34.41.176.245 | ||
port=14240 | ||
user=tigergraph | ||
pass=tigergraph | ||
graph=ldbc_fin | ||
maxPoolSize=160 | ||
|
||
############################################################ | ||
# Driver configurations # | ||
############################################################ | ||
status=1 | ||
thread_count=16 | ||
name=LDBC-FinBench | ||
# Modes available: 1.CREATE_VALIDATION 2.VALIDATE_DATABASE 3.EXECUTE_BENCHMARK | ||
mode=EXECUTE_BENCHMARK | ||
results_log=true | ||
time_unit=MICROSECONDS | ||
time_compression_ratio=0.1 | ||
peer_identifiers= | ||
workload_statistics=false | ||
spinner_wait_duration=1 | ||
help=false | ||
ignore_scheduled_start_times=false | ||
workload=org.ldbcouncil.finbench.driver.workloads.transaction.LdbcFinBenchTransactionWorkload | ||
db=org.ldbcouncil.finbench.impls.tigergraph.TigerGraphTransactionDb | ||
operation_count=1000000 | ||
validation_parameters_size=1000 | ||
validate_workload=true | ||
validate_database=validation_params.csv | ||
warmup=1000 | ||
ldbc.finbench.transaction.queries.parameters_dir=data/sf10/read_params | ||
ldbc.finbench.transaction.queries.updates_dir=data/sf10/incremental | ||
# param and update files suffix, `csv` or `parquet`, default is `csv` | ||
ldbc.finbench.transaction.queries.files_suffix=csv | ||
ldbc.finbench.transaction.queries.simple_read_dissipation=0.2 | ||
ldbc.finbench.transaction.queries.update_interleave=500 | ||
ldbc.finbench.transaction.queries.scale_factor=1 | ||
# Frequency of complex read queries | ||
ldbc.finbench.transaction.queries.ComplexRead1_freq=10 | ||
ldbc.finbench.transaction.queries.ComplexRead2_freq=45 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. keep the parameters same here |
||
ldbc.finbench.transaction.queries.ComplexRead3_freq=23 | ||
ldbc.finbench.transaction.queries.ComplexRead4_freq=57 | ||
ldbc.finbench.transaction.queries.ComplexRead5_freq=83 | ||
ldbc.finbench.transaction.queries.ComplexRead6_freq=21 | ||
ldbc.finbench.transaction.queries.ComplexRead7_freq=36 | ||
ldbc.finbench.transaction.queries.ComplexRead8_freq=51 | ||
ldbc.finbench.transaction.queries.ComplexRead9_freq=21 | ||
ldbc.finbench.transaction.queries.ComplexRead10_freq=6 | ||
ldbc.finbench.transaction.queries.ComplexRead11_freq=12 | ||
ldbc.finbench.transaction.queries.ComplexRead12_freq=34 | ||
# For debugging purposes | ||
ldbc.finbench.transaction.queries.ComplexRead1_enable=true | ||
ldbc.finbench.transaction.queries.ComplexRead2_enable=true | ||
ldbc.finbench.transaction.queries.ComplexRead3_enable=true | ||
ldbc.finbench.transaction.queries.ComplexRead4_enable=true | ||
ldbc.finbench.transaction.queries.ComplexRead5_enable=true | ||
ldbc.finbench.transaction.queries.ComplexRead6_enable=true | ||
ldbc.finbench.transaction.queries.ComplexRead7_enable=true | ||
ldbc.finbench.transaction.queries.ComplexRead8_enable=true | ||
ldbc.finbench.transaction.queries.ComplexRead9_enable=true | ||
ldbc.finbench.transaction.queries.ComplexRead10_enable=true | ||
ldbc.finbench.transaction.queries.ComplexRead11_enable=true | ||
ldbc.finbench.transaction.queries.ComplexRead12_enable=true | ||
ldbc.finbench.transaction.queries.SimpleRead1_enable=true | ||
ldbc.finbench.transaction.queries.SimpleRead2_enable=true | ||
ldbc.finbench.transaction.queries.SimpleRead3_enable=true | ||
ldbc.finbench.transaction.queries.SimpleRead4_enable=true | ||
ldbc.finbench.transaction.queries.SimpleRead5_enable=true | ||
ldbc.finbench.transaction.queries.SimpleRead6_enable=true | ||
ldbc.finbench.transaction.queries.Write1_enable=true | ||
ldbc.finbench.transaction.queries.Write2_enable=true | ||
ldbc.finbench.transaction.queries.Write3_enable=true | ||
ldbc.finbench.transaction.queries.Write4_enable=true | ||
ldbc.finbench.transaction.queries.Write5_enable=true | ||
ldbc.finbench.transaction.queries.Write6_enable=true | ||
ldbc.finbench.transaction.queries.Write7_enable=true | ||
ldbc.finbench.transaction.queries.Write8_enable=true | ||
ldbc.finbench.transaction.queries.Write9_enable=true | ||
ldbc.finbench.transaction.queries.Write10_enable=true | ||
ldbc.finbench.transaction.queries.Write11_enable=true | ||
ldbc.finbench.transaction.queries.Write12_enable=true | ||
ldbc.finbench.transaction.queries.Write13_enable=true | ||
ldbc.finbench.transaction.queries.Write14_enable=true | ||
ldbc.finbench.transaction.queries.Write15_enable=true | ||
ldbc.finbench.transaction.queries.Write16_enable=true | ||
ldbc.finbench.transaction.queries.Write17_enable=true | ||
ldbc.finbench.transaction.queries.Write18_enable=true | ||
ldbc.finbench.transaction.queries.Write19_enable=true | ||
ldbc.finbench.transaction.queries.ReadWrite1_enable=true | ||
ldbc.finbench.transaction.queries.ReadWrite2_enable=true | ||
ldbc.finbench.transaction.queries.ReadWrite3_enable=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
############################################################ | ||
# SUT defined configurations # | ||
############################################################ | ||
ipAddr=34.41.176.245 | ||
port=14240 | ||
user=tigergraph | ||
pass=tigergraph | ||
graph=ldbc_fin | ||
maxPoolSize=160 | ||
|
||
############################################################ | ||
# Driver configurations # | ||
############################################################ | ||
status=1 | ||
thread_count=16 | ||
name=LDBC-FinBench | ||
# Modes available: 1.CREATE_VALIDATION 2.VALIDATE_DATABASE 3.EXECUTE_BENCHMARK | ||
mode=CREATE_VALIDATION | ||
results_log=false | ||
time_unit=MICROSECONDS | ||
time_compression_ratio=0.001 | ||
peer_identifiers= | ||
workload_statistics=false | ||
spinner_wait_duration=1 | ||
help=false | ||
ignore_scheduled_start_times=false | ||
workload=org.ldbcouncil.finbench.driver.workloads.transaction.LdbcFinBenchTransactionWorkload | ||
db=org.ldbcouncil.finbench.impls.tigergraph.TigerGraphTransactionDb | ||
operation_count=1000000 | ||
validation_parameters_size=1000 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. keep the parameters same here |
||
validate_workload=true | ||
validate_database=validation_params.csv | ||
warmup=0 | ||
ldbc.finbench.transaction.queries.parameters_dir=data/sf1/read_params | ||
ldbc.finbench.transaction.queries.updates_dir=data/sf1/incremental | ||
# param and update files suffix, `csv` or `parquet`, default is `csv` | ||
ldbc.finbench.transaction.queries.files_suffix=csv | ||
ldbc.finbench.transaction.queries.simple_read_dissipation=0.2 | ||
ldbc.finbench.transaction.queries.update_interleave=2147483647 | ||
ldbc.finbench.transaction.queries.scale_factor=1 | ||
# Frequency of complex read queries | ||
ldbc.finbench.transaction.queries.ComplexRead1_freq=1 | ||
ldbc.finbench.transaction.queries.ComplexRead2_freq=1 | ||
ldbc.finbench.transaction.queries.ComplexRead3_freq=1 | ||
ldbc.finbench.transaction.queries.ComplexRead4_freq=1 | ||
ldbc.finbench.transaction.queries.ComplexRead5_freq=1 | ||
ldbc.finbench.transaction.queries.ComplexRead6_freq=1 | ||
ldbc.finbench.transaction.queries.ComplexRead7_freq=1 | ||
ldbc.finbench.transaction.queries.ComplexRead8_freq=1 | ||
ldbc.finbench.transaction.queries.ComplexRead9_freq=1 | ||
ldbc.finbench.transaction.queries.ComplexRead10_freq=1 | ||
ldbc.finbench.transaction.queries.ComplexRead11_freq=1 | ||
ldbc.finbench.transaction.queries.ComplexRead12_freq=1 | ||
# For debugging purposes | ||
ldbc.finbench.transaction.queries.ComplexRead1_enable=true | ||
ldbc.finbench.transaction.queries.ComplexRead2_enable=true | ||
ldbc.finbench.transaction.queries.ComplexRead3_enable=true | ||
ldbc.finbench.transaction.queries.ComplexRead4_enable=true | ||
ldbc.finbench.transaction.queries.ComplexRead5_enable=true | ||
ldbc.finbench.transaction.queries.ComplexRead6_enable=true | ||
ldbc.finbench.transaction.queries.ComplexRead7_enable=true | ||
ldbc.finbench.transaction.queries.ComplexRead8_enable=true | ||
ldbc.finbench.transaction.queries.ComplexRead9_enable=true | ||
ldbc.finbench.transaction.queries.ComplexRead10_enable=true | ||
ldbc.finbench.transaction.queries.ComplexRead11_enable=true | ||
ldbc.finbench.transaction.queries.ComplexRead12_enable=true | ||
ldbc.finbench.transaction.queries.SimpleRead1_enable=true | ||
ldbc.finbench.transaction.queries.SimpleRead2_enable=true | ||
ldbc.finbench.transaction.queries.SimpleRead3_enable=true | ||
ldbc.finbench.transaction.queries.SimpleRead4_enable=true | ||
ldbc.finbench.transaction.queries.SimpleRead5_enable=true | ||
ldbc.finbench.transaction.queries.SimpleRead6_enable=true | ||
ldbc.finbench.transaction.queries.Write1_enable=true | ||
ldbc.finbench.transaction.queries.Write2_enable=true | ||
ldbc.finbench.transaction.queries.Write3_enable=true | ||
ldbc.finbench.transaction.queries.Write4_enable=true | ||
ldbc.finbench.transaction.queries.Write5_enable=true | ||
ldbc.finbench.transaction.queries.Write6_enable=true | ||
ldbc.finbench.transaction.queries.Write7_enable=true | ||
ldbc.finbench.transaction.queries.Write8_enable=true | ||
ldbc.finbench.transaction.queries.Write9_enable=true | ||
ldbc.finbench.transaction.queries.Write10_enable=true | ||
ldbc.finbench.transaction.queries.Write11_enable=true | ||
ldbc.finbench.transaction.queries.Write12_enable=true | ||
ldbc.finbench.transaction.queries.Write13_enable=true | ||
ldbc.finbench.transaction.queries.Write14_enable=true | ||
ldbc.finbench.transaction.queries.Write15_enable=true | ||
ldbc.finbench.transaction.queries.Write16_enable=true | ||
ldbc.finbench.transaction.queries.Write17_enable=true | ||
ldbc.finbench.transaction.queries.Write18_enable=true | ||
ldbc.finbench.transaction.queries.Write19_enable=true | ||
ldbc.finbench.transaction.queries.ReadWrite1_enable=true | ||
ldbc.finbench.transaction.queries.ReadWrite2_enable=true | ||
ldbc.finbench.transaction.queries.ReadWrite3_enable=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<artifactId>impls</artifactId> | ||
<groupId>org.ldbcouncil.finbench</groupId> | ||
<version>0.1.0-alpha</version> | ||
</parent> | ||
|
||
<artifactId>tigergraph</artifactId> | ||
<name>tigergraph</name> | ||
<version>0.1.0-alpha</version> | ||
<description>A tigergraph implementation to help debug queries</description> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<maven.compiler.source>1.8</maven.compiler.source> | ||
<maven.compiler.target>1.8</maven.compiler.target> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>com.tigergraph</groupId> | ||
<artifactId>tigergraph-jdbc-driver</artifactId> | ||
<version>1.3.9</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.zaxxer</groupId> | ||
<artifactId>HikariCP</artifactId> | ||
<version>3.4.2</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-shade-plugin</artifactId> | ||
<version>3.4.1</version> | ||
<configuration> | ||
<!-- put your configurations here --> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>shade</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
USE GRAPH ldbc_fin | ||
CREATE or REPLACE QUERY tcr1( | ||
VERTEX<Account> id, | ||
UINT startTime, | ||
UINT endTime, | ||
INT truncationLimit, | ||
STRING truncationOrder | ||
) FOR GRAPH ldbc_fin syntax v1{ | ||
TYPEDEF TUPLE <UINT otherId, INT accountDistance, UINT mediumId, STRING mediumType> RESULT; | ||
SetAccum<RESULT> @result_set; | ||
HeapAccum<RESULT>(accountDistance ASC, otherId ASC, mediumId ASC) @@result; | ||
|
||
ArrayAccum<MinAccum<UINT>> @min_times[4]; | ||
|
||
StepNodes = {id}; | ||
|
||
TMP = SELECT s from StepNodes:s POST-ACCUM s.@min_times[0] += 0; | ||
|
||
INT i = 1; | ||
|
||
WHILE StepNodes.size() > 0 and i <= 3 DO | ||
StepNodes = | ||
SELECT t | ||
FROM StepNodes:s - (transfer:e) -> Account:t | ||
WHERE e.timestamp > startTime and e.timestamp < endTime | ||
and e.timestamp > s.@min_times[i-1] | ||
ACCUM t.@min_times[i] += e.timestamp; | ||
|
||
R = | ||
SELECT t | ||
FROM StepNodes:s - (signIn_REVERSE:e) -> Medium:t | ||
WHERE e.timestamp > startTime and e.timestamp < endTime and t.isBlocked == true | ||
ACCUM s.@result_set += RESULT(s.id, i, t.id, t.mediumType) | ||
POST-ACCUM | ||
FOREACH result in s.@result_set DO | ||
@@result += result | ||
END, | ||
s.@result_set.clear() | ||
; | ||
|
||
i = i + 1; | ||
|
||
END; | ||
|
||
PRINT @@result; | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should cd to tigergraph directory