generated from duckdb/extension-template
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
29 additions
and
26 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,29 @@ | ||
require duckpgq | ||
|
||
|
||
statement ok | ||
create table data_table as select * from read_csv("/export/scratch2/dljtw/duckpgq-issue200/links.tsv") | ||
|
||
statement ok | ||
CREATE TABLE devices AS SELECT a AS device FROM data_table UNION SELECT b AS device FROM data_table | ||
|
||
statement ok | ||
CREATE TABLE edges AS SELECT * FROM data_table | ||
|
||
statement ok | ||
-CREATE PROPERTY GRAPH graph | ||
VERTEX TABLES ( | ||
devices | ||
) | ||
EDGE TABLES ( | ||
edges | ||
SOURCE KEY (a) REFERENCES devices(device) | ||
DESTINATION KEY (b) REFERENCES devices(device) | ||
LABEL connects | ||
); | ||
|
||
statement ok | ||
set threads=1; -FROM weakly_connected_component(graph, devices, connects); | ||
# require duckpgq | ||
# | ||
# | ||
# statement ok | ||
# create or replace table data_table as select * from read_csv("/Users/dljtw/git/duckpgq/test/python/links.tsv"); | ||
# | ||
# statement ok | ||
# CREATE or replace TABLE devices AS SELECT a AS device FROM data_table UNION SELECT b AS device FROM data_table order by device; | ||
# | ||
# statement ok | ||
# CREATE or replace TABLE edges AS SELECT a.rowid as a, b.rowid as b FROM data_table e join devices a on a.device = e.a join devices b on b.device = e.b; | ||
# | ||
# statement ok | ||
# CREATE or replace TABLE nodes AS SELECT rowid as id from devices; | ||
# | ||
# statement ok | ||
# -CREATE OR REPLACE PROPERTY GRAPH graph | ||
# VERTEX TABLES ( | ||
# nodes | ||
# ) | ||
# EDGE TABLES ( | ||
# edges | ||
# SOURCE KEY (a) REFERENCES nodes(id) | ||
# DESTINATION KEY (b) REFERENCES nodes(id) | ||
# LABEL connects | ||
# ); | ||
# | ||
# statement ok | ||
# -FROM weakly_connected_component(graph, nodes, connects); |