From 29469dc9d436bb93417f7c723b770f098231c0a3 Mon Sep 17 00:00:00 2001 From: mahlon Date: Wed, 2 Apr 2025 03:30:22 +0000 Subject: [PATCH] Make the find actor path query a little more succinct. (And more importantly, this appears to work in kuzu v0.9.0 where the other did not.) FossilOrigin-Name: c1e6439201139141d0746577a70fb21ec1aee39247a9d12cc1ff81e6b572e84a --- experiments/imdb/imdb_find_actor_path.nim | 5 +---- experiments/imdb/imdb_import.nim | 1 - 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/experiments/imdb/imdb_find_actor_path.nim b/experiments/imdb/imdb_find_actor_path.nim index 0c050dd..6b50741 100644 --- a/experiments/imdb/imdb_find_actor_path.nim +++ b/experiments/imdb/imdb_find_actor_path.nim @@ -16,7 +16,6 @@ import std/math, std/os, std/sequtils, - std/strutils, std/strformat import kuzu @@ -56,9 +55,7 @@ if res.getNext[0].toInt64 < 1: quit 1 stmt = conn.prepare """ - MATCH (a:Actor {name:$fromActor}) - MATCH (b:Actor {name:$toActor}) - MATCH path = (a)-[r:ActedIn* ALL SHORTEST]-(b) + MATCH path = (a:Actor {name:$fromActor})-[r:ActedIn* ALL SHORTEST]-(b:Actor {name:$toActor}) RETURN DISTINCT nodes(path) AS nodes, length(path) AS hops ORDER BY hops """ diff --git a/experiments/imdb/imdb_import.nim b/experiments/imdb/imdb_import.nim index 13a9166..fdce275 100644 --- a/experiments/imdb/imdb_import.nim +++ b/experiments/imdb/imdb_import.nim @@ -13,7 +13,6 @@ # See: https://developer.imdb.com/non-commercial-datasets/ import - std/dirs, std/os, std/sequtils, std/strformat,