Skip to content

Commit bd5e055

Browse files
Merge pull request #10002 from soerenreichardt/remove-cypher-aggregation-extension
Remove cypher aggregation extension
2 parents 16777f4 + 606ce3a commit bd5e055

File tree

7 files changed

+28
-65
lines changed

7 files changed

+28
-65
lines changed

cypher-aggregation/src/main/java/org/neo4j/gds/projection/CypherAggregation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
public class CypherAggregation implements CallableUserAggregationFunction {
4747

4848
// NOTE: keep in sync with `procedureSyntax`
49-
static final QualifiedName FUNCTION_NAME = new QualifiedName(
49+
public static final QualifiedName FUNCTION_NAME = new QualifiedName(
5050
new String[]{"gds", "graph"},
5151
"project"
5252
);

cypher-aggregation/src/main/java/org/neo4j/gds/projection/CypherAggregationExtension.java

Lines changed: 0 additions & 63 deletions
This file was deleted.

procedures/extension/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ dependencies {
2121
implementation project(':core')
2222
implementation project(':core-utils')
2323
implementation project(':core-write')
24+
implementation project(':cypher-aggregation')
2425
implementation project(':defaults-and-limits-configuration')
2526
implementation project(':executor')
2627
implementation project(':graph-store-catalog-applications')

procedures/extension/src/main/java/org/neo4j/gds/extension/OpenGraphDataScienceExtension.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
import org.neo4j.gds.procedures.integration.DefaultExportLocation;
3636
import org.neo4j.gds.procedures.integration.LogAccessor;
3737
import org.neo4j.gds.procedures.integration.OpenGraphDataScienceExtensionBuilder;
38+
import org.neo4j.gds.projection.AlphaCypherAggregation;
39+
import org.neo4j.gds.projection.CypherAggregation;
3840
import org.neo4j.kernel.api.procedure.GlobalProcedures;
3941
import org.neo4j.kernel.extension.ExtensionFactory;
4042
import org.neo4j.kernel.extension.context.ExtensionContext;
@@ -78,6 +80,9 @@ public Lifecycle newInstance(ExtensionContext extensionContext, Dependencies dep
7880
var modelRepository = new OpenModelRepository(); // no model storing in OpenGDS
7981
var poolSizes = new OpenGdsPoolSizes(); // limited to four
8082

83+
var cypherAggregation = new CypherAggregation();
84+
var alphaCypherAggregation = new AlphaCypherAggregation();
85+
8186
var graphDataScienceExtensionBuilderAndAssociatedProducts = OpenGraphDataScienceExtensionBuilder.create(
8287
log,
8388
dependencySatisfier,
@@ -95,6 +100,8 @@ public Lifecycle newInstance(ExtensionContext extensionContext, Dependencies dep
95100
modelCatalog,
96101
modelRepository,
97102
poolSizes,
103+
cypherAggregation,
104+
alphaCypherAggregation,
98105
Optional.empty(), // no extra checks in OpenGDS
99106
Optional.empty(), // no extra checks in OpenGDS
100107
Optional.empty() // no extra checks in OpenGDS

procedures/integration/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ dependencies {
2222
implementation project(':config-api')
2323
implementation project(':core')
2424
implementation project(':core-write')
25+
implementation project(':cypher-aggregation')
2526
implementation project(':defaults-and-limits-configuration')
2627
implementation project(':executor')
2728
implementation project(':graph-store-catalog-applications')

procedures/integration/src/main/java/org/neo4j/gds/procedures/integration/OpenGraphDataScienceExtensionBuilder.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,11 @@
5050
import org.neo4j.gds.procedures.UserAccessor;
5151
import org.neo4j.gds.procedures.UserLogServices;
5252
import org.neo4j.gds.procedures.memory.MemoryFacade;
53+
import org.neo4j.gds.projection.AlphaCypherAggregation;
54+
import org.neo4j.gds.projection.CypherAggregation;
5355
import org.neo4j.gds.settings.GdsSettings;
5456
import org.neo4j.graphdb.config.Configuration;
57+
import org.neo4j.internal.kernel.api.exceptions.ProcedureException;
5558
import org.neo4j.kernel.api.procedure.GlobalProcedures;
5659
import org.neo4j.kernel.lifecycle.LifeSupport;
5760
import org.neo4j.kernel.lifecycle.Lifecycle;
@@ -61,6 +64,8 @@
6164
import java.util.concurrent.atomic.AtomicLong;
6265
import java.util.function.Function;
6366

67+
import static org.neo4j.gds.utils.StringFormatting.formatWithLocale;
68+
6469
/**
6570
* The GraphDataScience component has a certain contract,
6671
* in terms of the components it registers and the lifecycles it spawns.
@@ -135,6 +140,8 @@ public static Triple<OpenGraphDataScienceExtensionBuilder, TaskRegistryFactorySe
135140
ModelCatalog modelCatalog,
136141
ModelRepository modelRepository,
137142
PoolSizes poolSizes,
143+
CypherAggregation cypherAggregation,
144+
AlphaCypherAggregation alphaCypherAggregation,
138145
Optional<Function<AlgorithmProcessingTemplate, AlgorithmProcessingTemplate>> algorithmProcessingTemplateDecorator,
139146
Optional<Function<GraphCatalogApplications, GraphCatalogApplications>> graphCatalogApplicationsDecorator,
140147
Optional<Function<ModelCatalogApplications, ModelCatalogApplications>> modelCatalogApplicationsDecorator
@@ -184,6 +191,8 @@ public static Triple<OpenGraphDataScienceExtensionBuilder, TaskRegistryFactorySe
184191
return new MemoryFacade(user,memoryTracker);
185192
});
186193

194+
registerCypherAggregation(globalProcedures, cypherAggregation, alphaCypherAggregation, log);
195+
187196
var graphDataScienceProviderFactory = new GraphDataScienceProceduresProviderFactory(
188197
log,
189198
neo4jConfiguration,
@@ -218,6 +227,15 @@ public static Triple<OpenGraphDataScienceExtensionBuilder, TaskRegistryFactorySe
218227
return Triple.of(graphDataScienceExtensionBuilder, taskRegistryFactoryService, taskStoreService);
219228
}
220229

230+
private static void registerCypherAggregation(GlobalProcedures globalProcedures, CypherAggregation cypherAggregation, AlphaCypherAggregation alphaCypherAggregation, Log log) {
231+
try {
232+
globalProcedures.register(cypherAggregation);
233+
globalProcedures.register(alphaCypherAggregation);
234+
} catch (ProcedureException e) {
235+
log.warn(formatWithLocale("`%s` is not available", CypherAggregation.FUNCTION_NAME), e);
236+
}
237+
}
238+
221239
/**
222240
* At this point we have all the bits ready, so we assemble and register them with Neo4j.
223241
* There are some legacy bits that are still part of the contract, they will disappear gradually,

triplet-graph-builder/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ dependencies {
3030
implementation project(':logging')
3131
implementation project(':memory-usage')
3232
implementation project(':neo4j-log-adapter')
33-
implementation project(':proc-common')
3433
implementation project(':progress-tracking')
3534
implementation project(':string-formatting')
3635

0 commit comments

Comments
 (0)