diff --git a/core/src/main/java/org/neo4j/gds/core/loading/LazyIdMapBuilder.java b/core/src/main/java/org/neo4j/gds/core/loading/LazyIdMapBuilder.java index f73203b478..2795bda2f3 100644 --- a/core/src/main/java/org/neo4j/gds/core/loading/LazyIdMapBuilder.java +++ b/core/src/main/java/org/neo4j/gds/core/loading/LazyIdMapBuilder.java @@ -48,7 +48,6 @@ public LazyIdMapBuilder( this.intermediateIdMapBuilder = ShardedLongLongMap.builder(concurrency); this.nodesBuilder = GraphFactory.initNodesBuilder() .concurrency(concurrency) - .maxOriginalId(NodesBuilder.UNKNOWN_MAX_ID) .hasLabelInformation(hasLabelInformation) .hasProperties(hasProperties) .deduplicateIds(false) diff --git a/core/src/main/java/org/neo4j/gds/core/loading/construction/GraphFactory.java b/core/src/main/java/org/neo4j/gds/core/loading/construction/GraphFactory.java index 896ef24f9e..3a0223d35b 100644 --- a/core/src/main/java/org/neo4j/gds/core/loading/construction/GraphFactory.java +++ b/core/src/main/java/org/neo4j/gds/core/loading/construction/GraphFactory.java @@ -79,7 +79,7 @@ public static NodesBuilderBuilder initNodesBuilder(NodeSchema nodeSchema) { @Builder.Factory static NodesBuilder nodesBuilder( - long maxOriginalId, + Optional maxOriginalId, Optional nodeCount, Optional nodeSchema, Optional hasLabelInformation, @@ -95,20 +95,18 @@ static NodesBuilder nodesBuilder( int threadCount = concurrency.orElse(1); var idMapBehavior = IdMapBehaviorServiceProvider.idMapBehavior(); - var maybeMaxOriginalId = maxOriginalId != NodesBuilder.UNKNOWN_MAX_ID - ? Optional.of(maxOriginalId) - : Optional.empty(); var idMapType = idMapBuilderType.orElse(IdMap.NO_TYPE); var idMapBuilder = idMapBehavior.create( idMapType, threadCount, - maybeMaxOriginalId, + maxOriginalId, nodeCount ); + long maxOriginalNodeId = maxOriginalId.orElse(NodesBuilder.UNKNOWN_MAX_ID); boolean deduplicate = deduplicateIds.orElse(true); - long maxIntermediateId = maxOriginalId; + long maxIntermediateId = maxOriginalNodeId; if (HighLimitIdMap.isHighLimitIdMap(idMapType)) { // If the requested id map is high limit, we need to make sure that @@ -129,7 +127,7 @@ static NodesBuilder nodesBuilder( return nodeSchema.isPresent() ? fromSchema( - maxOriginalId, + maxOriginalNodeId, maxIntermediateId, idMapBuilder, threadCount, @@ -138,7 +136,7 @@ static NodesBuilder nodesBuilder( deduplicate ) : new NodesBuilder( - maxOriginalId, + maxOriginalNodeId, maxIntermediateId, threadCount, NodesBuilderContext.lazy(threadCount), diff --git a/legacy-cypher-projection/src/main/java/org/neo4j/gds/legacycypherprojection/CypherNodeLoader.java b/legacy-cypher-projection/src/main/java/org/neo4j/gds/legacycypherprojection/CypherNodeLoader.java index 8c3621d4cf..bb5f699dae 100644 --- a/legacy-cypher-projection/src/main/java/org/neo4j/gds/legacycypherprojection/CypherNodeLoader.java +++ b/legacy-cypher-projection/src/main/java/org/neo4j/gds/legacycypherprojection/CypherNodeLoader.java @@ -64,7 +64,6 @@ BatchLoadResult loadSingleBatch(InternalTransaction tx, int bufferSize) { this.nodesBuilder = GraphFactory.initNodesBuilder() .nodeCount(nodeCount) - .maxOriginalId(NodesBuilder.UNKNOWN_MAX_ID) .hasLabelInformation(hasLabelInformation) .hasProperties(!propertyColumns.isEmpty()) .propertyState(PropertyState.TRANSIENT)