Skip to content

Commit

Permalink
Create larger test,
Browse files Browse the repository at this point in the history
  • Loading branch information
Dtenwolde committed Nov 14, 2024
1 parent 4c0a671 commit 8f1b929
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 6 deletions.
5 changes: 5 additions & 0 deletions src/core/operator/physical_path_finding_operator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,12 @@ PhysicalPathFinding::GetData(ExecutionContext &context, DataChunk &result,
if (pf_sink.global_pairs->Count() == 0) {
return SourceResultType::FINISHED;
}
if (pf_bfs_state->pairs->size() > STANDARD_VECTOR_SIZE) {

}

pf_bfs_state->result.SetCardinality(*pf_bfs_state->pairs);

result.Move(*pf_bfs_state->pairs);
result.Fuse(pf_bfs_state->result);

Expand Down
12 changes: 6 additions & 6 deletions test/sql/path_finding/parallel_path_finding.test
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ create table student(id INT); INSERT INTO student(id) VALUES (10), (20), (30), (
statement ok
create table know(src INT, dst INT); INSERT INTO know(src, dst) VALUES (40, 20), (10,30), (10,10), (20,10), (30,10);

statement ok
-CREATE PROPERTY GRAPH g
VERTEX TABLES (student)
EDGE TABLES (know SOURCE KEY ( src ) REFERENCES Student ( id )
DESTINATION KEY ( dst ) REFERENCES Student ( id )
);
#statement ok
#-CREATE PROPERTY GRAPH g
#VERTEX TABLES (student)
#EDGE TABLES (know SOURCE KEY ( src ) REFERENCES Student ( id )
# DESTINATION KEY ( dst ) REFERENCES Student ( id )
# );

query III
with csr_cte as (
Expand Down
51 changes: 51 additions & 0 deletions test/sql/path_finding/path_finding_snb.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@


require duckpgq

statement ok
set experimental_path_finding_operator=true;

statement ok
select setseed(0.42);

statement ok
create table person as (select * from read_csv_auto('/Users/dljtw/git/duckpgq-experiments/data/SNB1-projected|/person.csv'));

statement ok
create table person_knows_person as (select * from read_csv_auto('/Users/dljtw/git/duckpgq-experiments/data/SNB1-projected|/person_knows_person.csv'));


statement ok
create or replace table snb_pairs as (
select src, dst
from (select a.rowid as src from person a),
(select b.rowid as dst from person b)
using sample reservoir(3000 rows) repeatable (300)
);

statement ok
with csr_cte as (
SELECT cast(min(create_csr_edge(
0,
(SELECT count(a.id) FROM person a),
CAST (
(SELECT sum(create_csr_vertex(
0,
(SELECT count(a.id) FROM person a),
sub.dense_id,
sub.cnt))
FROM (
SELECT a.rowid as dense_id, count(k.person1id) as cnt
FROM person a
LEFT JOIN person_knows_person k ON k.person1id = a.id
GROUP BY a.rowid) sub
)
AS BIGINT),
(select count() FROM person_knows_person k JOIN person a on a.id = k.person1id JOIN person c on c.id = k.person2id),
a.rowid,
c.rowid,
k.rowid)) as bigint) as csr_id
FROM person_knows_person k
JOIN person a on a.id = k.person1id
JOIN person c on c.id = k.person2id)
SELECT src as source, dst as destination, shortestpathoperator(src, dst, csr_id) as path FROM snb_pairs, csr_cte;

0 comments on commit 8f1b929

Please sign in to comment.