Skip to content

Commit

Permalink
Merge pull request #8597 from knutwalker/cp2-config-return
Browse files Browse the repository at this point in the history
Return the pruned config map from Cypher Projection v2
  • Loading branch information
knutwalker authored Jan 16, 2024
2 parents 7152968 + d295bf0 commit cafdb61
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ public AggregationResult result(
.nodeCount(graphStore.nodeCount())
.relationshipCount(graphStore.relationshipCount())
.projectMillis(projectMillis)
.configuration(this.config.toMap())
.configuration(this.config.asProcedureResultConfigurationField())
.query(this.query)
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ default Set<String> outputFieldDenylist() {
return Set.of(
NODE_COUNT_KEY,
RELATIONSHIP_COUNT_KEY,
READ_CONCURRENCY_KEY,
SUDO_KEY,
VALIDATE_RELATIONSHIPS_KEY
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
import org.neo4j.graphdb.Result;
import org.neo4j.kernel.api.procedure.GlobalProcedures;

import java.time.ZonedDateTime;
import java.util.List;
import java.util.Map;
import java.util.Optional;
Expand All @@ -66,6 +67,7 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatCode;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.hamcrest.Matchers.any;
import static org.hamcrest.Matchers.instanceOf;
import static org.neo4j.gds.utils.StringFormatting.formatWithLocale;

Expand Down Expand Up @@ -779,6 +781,26 @@ void testPipelinePseudoAnonymous() {
);
}


@Test
void testReturnedConfig() {
var query = "MATCH (a:A)-[:REL]->(b) " +
"WITH gds.graph.project('g', a, b) AS g " +
"RETURN g.configuration AS config";
assertCypherResult(
query,
List.of(Map.of("config", Map.of(
"creationTime", any(ZonedDateTime.class),
"inverseIndexedRelationshipTypes", List.of(),
"jobId", any(String.class),
"logProgress", true,
"query", query,
"readConcurrency", 4,
"undirectedRelationshipTypes", List.of()
)))
);
}

@Test
void testAlphaForwarding() {
runQuery(
Expand Down

0 comments on commit cafdb61

Please sign in to comment.