Skip to content
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

Add missing relation type filter #191

Merged
merged 2 commits into from
Jul 31, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions components/server/src/database/dsls/object_dsl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -501,10 +501,11 @@ impl Object {
let query = "/*+ indexscan(ir) set(yb_bnl_batch_size 1024) */
WITH RECURSIVE paths AS (
SELECT ir.*
FROM internal_relations ir WHERE ir.target_pid = $1
FROM internal_relations ir WHERE ir.target_pid = $1 AND ir.relation_name = 'BELONGS_TO'
UNION
SELECT ir2.*
FROM paths, internal_relations ir2 WHERE ir2.target_pid = paths.origin_pid
FROM paths, internal_relations ir2
WHERE ir2.target_pid = paths.origin_pid AND ir2.relation_name = 'BELONGS_TO'
) SELECT * FROM paths;";

// Execute query and convert rows to InternalRelations
Expand All @@ -529,10 +530,10 @@ impl Object {
let query = "/*+ indexscan(ir) set(yb_bnl_batch_size 1024) */
WITH RECURSIVE paths AS (
SELECT ir.*
FROM internal_relations ir WHERE ir.target_pid = $1
FROM internal_relations ir WHERE ir.target_pid = $1 AND ir.relation_name = 'BELONGS_TO'
UNION
SELECT ir2.*
FROM paths, internal_relations ir2 WHERE ir2.target_pid = paths.origin_pid
FROM paths, internal_relations ir2 WHERE ir2.target_pid = paths.origin_pid AND ir2.relation_name = 'BELONGS_TO'
) SELECT * FROM paths;";

// Execute query and convert rows to InternalRelations
Expand Down Expand Up @@ -1286,6 +1287,7 @@ pub fn extract_paths_from_graph(edge_list: Vec<InternalRelation>) -> Result<Vec<
projects.insert(edge.origin_pid);
}
}
dbg!(&children_map);

let mut queue: VecDeque<(Hierarchy, DieselUlid)> = VecDeque::new();
let mut results: Vec<Hierarchy> = vec![];
Expand Down
Loading