From 7b4175c3a86668e5b87b12ee45acf4de63fc608b Mon Sep 17 00:00:00 2001 From: Paul Horn Date: Mon, 20 Nov 2023 18:33:27 +0100 Subject: [PATCH] Don't extract the query on composite databases --- .../org/neo4j/gds/projection/CypherAggregation.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/cypher-aggregation/src/main/java/org/neo4j/gds/projection/CypherAggregation.java b/cypher-aggregation/src/main/java/org/neo4j/gds/projection/CypherAggregation.java index 4449df1324..2e24adcfd0 100644 --- a/cypher-aggregation/src/main/java/org/neo4j/gds/projection/CypherAggregation.java +++ b/cypher-aggregation/src/main/java/org/neo4j/gds/projection/CypherAggregation.java @@ -109,10 +109,18 @@ public CompatUserAggregator create(Context ctx) throws ProcedureException { var metricsFacade = Neo4jProxy.lookupComponentProvider(ctx, MetricsFacade.class, true); var username = Neo4jProxy.lookupComponentProvider(ctx, Username.class, true); var transaction = Neo4jProxy.lookupComponentProvider(ctx, Transaction.class, true); - var ktxs = GraphDatabaseApiProxy.resolveDependency(databaseService, KernelTransactions.class); - var queryProvider = ExecutingQueryProvider.fromTransaction(ktxs, transaction); var runsOnCompositeDatabase = Neo4jProxy.isCompositeDatabase(databaseService); + + ExecutingQueryProvider queryProvider; + if (runsOnCompositeDatabase) { + queryProvider = ExecutingQueryProvider.empty(); + } else { + assert GraphDatabaseApiProxy.containsDependency(databaseService, KernelTransactions.class); + var ktxs = GraphDatabaseApiProxy.resolveDependency(databaseService, KernelTransactions.class); + queryProvider = ExecutingQueryProvider.fromTransaction(ktxs, transaction); + } + var writeMode = runsOnCompositeDatabase ? WriteMode.NONE : WriteMode.LOCAL;