Skip to content

fix: #9146 #9125 #9124 #9123 BigInteger precision, index delete bounds, r:R subtypes, streaming allShortestPaths - #9160

Merged
lvca merged 11 commits into
mainfrom
fix/9146-9125-9124-9123
Oct 4, 2026
Merged

lvca merged 11 commits into
mainfrom
fix/9146-9125-9124-9123

Conversation

@lvca

@lvca lvca commented Oct 4, 2026 •

Copy link
Copy Markdown
Member

Fixes #9146, #9125, #9124, #9123.

Also noted: BETWEEN on an integral value is now evaluated against numeric bounds without converting them to the value's class (part of the stacked #9021 change).

Stacked: this branch carries the commits of #9126 (#9021, needed by #9125) and #9120 (#8995, needed by #9123), which are still open. The all-paths result of the RETURN allShortestPaths(...) expression comes from #9120 and deserves a release note. They drop out of the diff once those merge.

Tests: new Issue9146*, Issue9125*, Issue9124*, Issue9123*; the #8995 timeout test now names the streaming step. 6506 engine tests of the affected packages green.

Summary by CodeRabbit

  • Bug Fixes
    • Numeric range queries now handle fractional, out-of-range, and non-finite bounds consistently across integral indexes, including index deletion.
    • Relationship label checks now recognize matching subtypes.
    • Large integer values beyond the long range are preserved as exact decimals instead of being rounded.
  • Performance
    • Shortest-path results are produced incrementally, allowing limited queries to return results without first building every path.

robfrank and others added 7 commits October 3, 2026 23:58
…not the truncated one

A bound no BYTE/SHORT/INTEGER/LONG key equals (12.5, 1e19, 3e9 on an INTEGER) is mapped onto the
key that bounds the same set, inclusive, or matches nothing, in SQL (FetchFromIndexStep),
openCypher (NodeIndexRangeScan) and the fluent Select API. The SQL BETWEEN scan no longer
converts a numeric bound to an integer value's class.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The unconstrained layered BFS recorded the parent vertex once per
relationship and rebuilt every hop with the first relationship found
between the two vertices, so N parallel relationships produced N rows of
the same path. Parents are now recorded once and the back-tracking
branches on every relationship joining each hop (looked up through the
neighbour-filtered edge iterators). The RETURN allShortestPaths(...)
expression form now shares the same evaluators and returns every
co-shortest path instead of a single one.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ression timeout, self-pair and hop-bound tests

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…l-chain timeout test, diamond with a parallel pair

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…arrays, shorter comment

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…M index fractional bounds (#9125), WHERE r:R includes subtypes (#9124), allShortestPaths streams its paths (#9123)
@lvca lvca added this to the 26.10.1 milestone Oct 4, 2026
@lvca lvca self-assigned this Oct 4, 2026
@coderabbitai

coderabbitai Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1751d8ef-2e92-4798-a202-d105634c1fa2
📥 Commits

Reviewing files that changed from the base of the PR and between 50657bd and 433ffcb.

📒 Files selected for processing (16)
  • engine/src/main/java/com/arcadedb/index/IntegralKeyBound.java
  • engine/src/main/java/com/arcadedb/query/opencypher/ast/LabelCheckExpression.java
  • engine/src/main/java/com/arcadedb/query/opencypher/executor/operators/NodeIndexRangeScan.java
  • engine/src/main/java/com/arcadedb/query/opencypher/executor/steps/ShortestPathStep.java
  • engine/src/main/java/com/arcadedb/query/select/SelectExecutor.java
  • engine/src/main/java/com/arcadedb/query/sql/executor/DeleteFromIndexStep.java
  • engine/src/main/java/com/arcadedb/query/sql/executor/FetchFromIndexStep.java
  • engine/src/main/java/com/arcadedb/query/sql/parser/BetweenCondition.java
  • engine/src/main/java/com/arcadedb/serializer/BinarySerializer.java
  • engine/src/main/java/com/arcadedb/serializer/BinaryTypes.java
  • engine/src/test/java/com/arcadedb/query/Issue9021IntegralIndexInexactBoundTest.java
  • engine/src/test/java/com/arcadedb/query/opencypher/CypherAllShortestPathsParallelEdgesIssue8995Test.java
  • engine/src/test/java/com/arcadedb/query/opencypher/Issue9123AllShortestPathsStreamingTest.java
  • engine/src/test/java/com/arcadedb/query/opencypher/Issue9124RelationshipSubtypeLabelCheckTest.java
  • engine/src/test/java/com/arcadedb/query/sql/executor/Issue9125DeleteFromIndexInexactBoundTest.java
  • engine/src/test/java/com/arcadedb/schema/Issue9146UndeclaredBigIntegerTest.java
 _____________________________________
< Please step away from the keyboard! >
 -------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@mergify

mergify Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again.

@codacy-production

codacy-production Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Not up to standards ⛔

🔴 Issues 2 high · 2 minor

Alerts:
⚠ 4 issues (≤ 0 issues of at least minor severity)

Results:
4 new issues

Category Results
BestPractice 1 minor
ErrorProne 2 high
CodeStyle 1 minor

View in Codacy

🟢 Metrics 133 complexity

Metric Results
Complexity 133

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@claude

claude Bot commented Oct 4, 2026

Copy link
Copy Markdown

Review of #9160

Reviewed the four fixes on top of the stacked #9126 / #9120 commits, focusing on the code that is new in this PR (DeleteFromIndexStep, LabelCheckExpression, ShortestPathStep/ShortestPathExpression, BinaryTypes/BinarySerializer). Overall this is solid work: root causes are fixed rather than patched, each issue has a dedicated regression test, and the style matches CLAUDE.md. I did not build or run the tests; this is a read-through only.

Worth addressing

  1. RETURN allShortestPaths(...) now materializes every co-shortest path (ShortestPathExpression.java, ~line 150). Before, the expression form returned one path. It now calls computeAllShortestPaths/computeFilteredAllShortestPaths, which drain() the iterator into an ArrayList. The PR description says the expression still materializes, but on the graph shape that motivated openCypher MATCH p = allShortestPaths(...) materializes every path before emitting the first row #9123 (4 parallel edges x 12 hops = 16.7M paths) this expression will now OOM where it used to return quickly. The deadline check fires only every 1024 paths, so it does not bound memory. Consider a cap on the drained list, or at least a test and an explicit note that this is a deliberate behavior change. No test in this PR covers the expression form on a many-path graph.

  2. Possible ClassCastException in DeleteFromIndexStep.processBetweenCondition. When one bound is inexact and the other is not a Number (e.g. BETWEEN 11.5 AND 'x'), the ((Number) thirdValue).longValue() cast throws, whereas BetweenCondition deliberately treats such bounds as "not between" (BinaryComparator narrows the wider operand and parseInt()s string operands: NumberFormatException on numeric-vs-string (via SQL) and a non-antisymmetric order #5900). A instanceof Number guard on both values before the comparison would fix it (NodeIndexRangeScan in this PR already guards this way).

  3. Lazy enumeration versus writes in the same query (ShortestPathStep.PathEnumerator). Paths are now resolved on demand, so edges and vertices are loaded after downstream steps may already have run for earlier rows. For MATCH p = allShortestPaths(...) ... DELETE r a downstream write could remove an edge the enumerator has not resolved yet. I did not confirm whether the Cypher planner puts an eager barrier between the read and write clause here. A test would settle it.

Minor

Positives

  • Fixing the two latent DeleteFromIndexStep bugs (nested key array passed to remove, =/</<= scanning the wrong range) and covering them with tests is great.
  • IntegralKeyBound allocates nothing for the common in-range integral case, in line with the performance guidance.
  • Shared static direction arrays and neighbor-filtered edge lookups in collectConnectingEdges cut garbage and avoid loading every edge of a vertex.
  • The explicit-stack PathEnumerator with a per-vertex hop cache is a clean replacement for the recursive collector.

No security concerns found. Nothing blocking beyond confirming item 1 is an intentional trade-off.

🤖 Generated with Claude Code

@lvca

lvca commented Oct 4, 2026

Copy link
Copy Markdown
Member Author

Review round 1: fixed the ClassCastException guard on non-numeric BETWEEN bounds (#2), added comments for the Long.MIN_VALUE threshold and the ignored scan order, plus tests for a write clause after the match (#3, no disturbance) and a two-level subtype chain. #1 is not a regression: the RETURN expression form already built the full list on main before this PR (#8995), and bounding it is a separate change.

@claude

claude Bot commented Oct 4, 2026

Copy link
Copy Markdown

Review

Overall this is a careful, well-tested set of fixes. I read the diff of the four issues plus the stacked #9021/#8995 commits. No blocking problems found; notes below.

What looks good

Points worth a look

  1. Behaviour change in RETURN allShortestPaths(...) (ShortestPathExpression): in expression position it used to return a single-path list and now returns every co-shortest path, fully materialized. With parallel edges the count is a product per hop, so a query that used to return one row can now allocate a huge list. The deadline guard only fires every 1024 paths and does nothing about heap. This is documented in the PR body, but consider a release-note mention and/or a configurable cap for the expression form. It also no longer goes through SQLFunctionShortestPath (CSR acceleration), which is fine for all-paths but is a perf delta to be aware of.
  2. Memory claim: "memory stays bounded by the batch" is true for the path list, but the BFS predecessors/distance maps and hopCache still grow with the number of visited vertices. Fine, but the wording slightly overstates it.
  3. Duplicated inexact-bound plumbing: the "map ceiling/floor, then detect the empty lower.longValue() > upper.longValue() range" logic now appears in FetchFromIndexStep (twice: mapInexactIntegralBounds and mapInexactIntegralBound), SelectExecutor, DeleteFromIndexStep and NodeIndexRangeScan. Per the "reuse existing components" guideline, a small helper on IntegralKeyBound (e.g. isEmptyRange(keyType, lower, upper)) would keep the four call sites from drifting apart.
  4. seek[2] as a Boolean[] smuggled into Object[][] (FetchFromIndexStep): sortSeeksInIndexOrder already needed a special case ("seek[2] holds the inclusion flags, not a bound"), which is a sign this wants a tiny holder class (from, to, fromIncluded, toIncluded). It would also avoid the boxing and the (Boolean) casts in the comparator.
  5. Minor style: DeleteFromIndexStep.createCursor reassigns the value parameter and drops final; CLAUDE.md prefers final where possible (a local final Object bound would do). checkPathEnumeration calls Thread.interrupted(), which clears the flag before throwing; consider re-setting it or using isInterrupted() if callers rely on the flag.
  6. Test gaps (optional):

Process

@lvca

lvca commented Oct 4, 2026

Copy link
Copy Markdown
Member Author

Review round 2. Correction to my earlier comment: on main the RETURN allShortestPaths(...) expression returned a single path, so the all-paths list in expression position is a behaviour change that comes with the stacked #8995 commits (#9120), not with the four fixes here. It needs a release-note mention and possibly a cap; that belongs to #9120 and is left there. Also changed: createCursor keeps its parameter final, and a test covers fractional bounds at the edges of the INTEGER key range. Not changed: the shared inexact-bound helper and the seek holder class (IntegralKeyBound and FetchFromIndexStep belong to the stacked #9126), and Thread.interrupted() matches the existing pattern in the class.

@claude

claude Bot commented Oct 4, 2026

Copy link
Copy Markdown

Review of #9160

Overall this is solid work: each of the four fixes has a focused regression test, the explicit-stack PathEnumerator is a clean replacement for the recursive back-tracking, and IntegralKeyBound gives the inexact-bound mapping one well-documented home. I did not run the build or tests; this is a read-through of the diff. Findings below, roughly by importance.

Worth addressing

  1. RETURN allShortestPaths(...) now enumerates every co-shortest path, fully materialized (ShortestPathExpression.java, ~L149-160). Before, the expression form returned a one-element list. Now it drains the whole enumeration into a list. On the graph used by Issue9123AllShortestPathsStreamingTest (12 hops x 4 parallel edges, 16.7M paths) that expression would try to hold 16.7M paths in memory. The only protection is the guard.check() every 1024 paths, which helps only when a command deadline is set. The PR description says the expression "still materializes", but not that its result changes from one path to all of them. Please call that out in the description, and consider a hard cap (or a clear error) on the materializing path. Is there a test that pins the new expression-form semantics (unconstrained and constrained)?

  2. Lazy enumeration resolves records at pull time. resolveHops/resolveFilteredHops call database.lookupByRID(...) as the iterator advances, and collectConnectingEdges loads edges then. If a parent vertex is deleted between pulls, RecordNotFoundException escapes from hasNext(). The write-clause test covers deleting edges of a small graph, but not deleting a vertex mid-enumeration. Probably acceptable, but worth a conscious decision (the old code resolved everything up front).

Code quality / style

  1. Duplicated inexact-bound logic in four places (FetchFromIndexStep, DeleteFromIndexStep, SelectExecutor, NodeIndexRangeScan). Each repeats isInexact -> ceiling/floor -> null handling -> "mapped lower > mapped upper means empty" (lower.longValue() > upper.longValue() appears 4 times, each with slightly different guards). Since IntegralKeyBound already exists, helpers like lowerBound(keyType, bound) / upperBound(...) returning the mapped key or a sentinel, plus an isEmptyRange(lower, upper), would remove the drift risk (the repo already had a drift incident, see the comment on CURSOR_BUILDABLE_OPERATORS).

  2. SelectExecutor: NO_KEY is inserted between the all-caps comment block and the CURSOR_BUILDABLE_OPERATORS field it documents (~L83-90), so that comment now reads as if it describes NO_KEY. Move NO_KEY above the comment block or elsewhere.

  3. SelectExecutor: from != rightValue / to != rightValue is a reference comparison used as "was the bound mapped". It works because integralLowerBound returns the same instance when nothing is mapped, but it is easy to break in a later refactor. An explicit boolean from the helper would be clearer.

  4. FetchFromIndexStep: seek is Object[][] { from, to, { Boolean, Boolean } }, with boxed flags read back via (Boolean) seek[2][0] and a comparator doing Boolean.compare(...) * 2 + .... It is type-unsafe and allocates extra arrays per seek on a hot query path. A tiny private final class/record (from, to, fromIncluded, toIncluded) would be safer and cheaper, and sortSeeksInIndexOrder would no longer need the "seek[2] holds the flags, not a bound" caveat.

  5. BinarySerializer: final BigDecimal decimal = ... is declared directly inside case TYPE_DECIMAL: without braces, so it is in scope for the following case labels. The next case already uses { ... }; please do the same here.

  6. BinaryTypes: the bitLength() > 63 condition is correct (Long.MIN_VALUE/MAX_VALUE have bitLength 63), but such a value now reads back as BigDecimal, not BigInteger. That seems intended and is tested in Issue9146UndeclaredBigIntegerTest; just make sure it is mentioned in release notes since it is observable to users (and to JSON export of such properties).

Performance

  • LabelCheckExpression now does edge.getType() plus instanceOf(label) per evaluated edge instead of a string compare. Acceptable for correctness; hot filters over many edges pay a little more.
  • The shared OUT_ONLY/IN_ONLY/OUT_IN arrays and the neighbour-filtered getEdgesConnectedTo lookup in collectConnectingEdges are nice wins (no per-expansion array allocation, no loading of every edge of a high-degree vertex).

Tests

Security
No concerns: no new dependencies, and no user-controlled allocation beyond the item 1 materialization case.

The two fixes in DeleteFromIndexStep (nested key array passed to index.remove, and =/</<= removing the wrong ranges) are real data-correctness fixes, nice catch.

@lvca

lvca commented Oct 4, 2026

Copy link
Copy Markdown
Member Author

Review round 3. Fixed: braces around the TYPE_DECIMAL case (#7). Not changed: #1 is the stacked #8995 behaviour (see the previous comment); #3 to #6 are in IntegralKeyBound / FetchFromIndexStep / SelectExecutor from the stacked #9126 and are better handled there; #2 (a vertex deleted between pulls) matches how every other lazily resolved step behaves in this engine; #8 is a release-note item. The BETWEEN case on SHORT and BYTE is covered by the DELETE tests, which run every integral key type.

@lvca

lvca commented Oct 4, 2026

Copy link
Copy Markdown
Member Author

Note: Issue8872DecimalLiteralDigitsTest (indexedAndUnindexedDoubleAgreeOnALongLiteral, updateDeleteAndInOnIndexedDecimalAndDouble) fails on a clean main checkout as well, so it is not caused by this PR.

@claude

claude Bot commented Oct 4, 2026

Copy link
Copy Markdown

Review of #9160

I read the diff and did not build it or run the tests. Overall this is a careful change with good test coverage. I found no blocking bugs, only the points below.

What looks good

  • IntegralKeyBound: one helper shared by all the index paths (FetchFromIndexStep, SelectExecutor, NodeIndexRangeScan, DeleteFromIndexStep). It is exact (BigDecimal ceiling and floor), handles NaN and infinities, and isInexact does not allocate for the common in-range integral case.
  • DeleteFromIndexStep: index.remove((Object[]) entry.getFirst(), value) fixes the nested-array bug. =, < and <= are now bounded on the correct side, and delete no longer depends on orderAsc. Issue9125DeleteFromIndexInexactBoundTest covers these.
  • PathEnumerator: an explicit-stack DFS with one frame per hop and a hopCache, so LIMIT stops the enumeration. Parallel edges are de-duplicated at BFS time with the "last parent" check, which is valid because a vertex's relationships are walked contiguously. The deadline check every 1024 paths is a sensible guard.
  • LabelCheckExpression: instanceOf(label) matches the polymorphic [r:R] semantics.
  • BinaryTypes: the bitLength() > 63 threshold is right (Long.MIN_VALUE has bitLength() == 63, as the comment notes), and BinarySerializer handles BigInteger in the DECIMAL case.
  • Tests: each issue has its own regression test, including empty-range and composite-index edge cases.

Points to consider

  1. RETURN allShortestPaths(...) now materializes every path. Before, the expression form returned only the single shortest path. It now returns the full list, which is the correct OpenCypher result, but the path count is the product of the parallel edges per hop, so a graph with many parallel edges can build a very large list. The guard every 1024 paths bounds time, not memory. This may be acceptable, but it is a behavior change worth a release note, and a cap or configurable limit would be safer.
  2. The "memory stays bounded by the batch" claim is slightly overstated. The BFS distance and predecessors maps are still O(visited vertices), and hopCache grows with the hops touched. Only the path list no longer materializes in the MATCH form. Rewording the PR description or Javadoc would be more precise.
  3. ShortestPathExpression: new ArrayList<>(computeFiltered... / computeAll...) copies a list that is already a fresh ArrayList (drain builds one). The copy can be dropped.
  4. SelectExecutor: from != rightValue and to != rightValue compare references to detect "was mapped". It works because the helpers return the same instance when nothing is mapped, but it is fragile. Checking isInexact once would state the intent more clearly. FetchFromIndexStep has the same pattern (key[last] != values[last]).
  5. FetchFromIndexStep seek triple: Object[][] { from, to, { Boolean, Boolean } } puts boxed Booleans in an Object[][], which adds casts and boxing on the seek path, and seek[2] must be skipped in sortSeeksInIndexOrder. A tiny Seek record with boolean fields would remove that. The Boolean.compare(...) * 2 + ... comparison is sound (|b| <= 1 < 2 makes it lexicographic), but a one-line comment would help the next reader.
  6. BetweenCondition: non-index evaluation also changes. An integral value is now compared against numeric bounds without conversion. That is correct for An index on an INTEGER or LONG answers for a bound truncated to the key type: SQL WHERE i = 12.5 returns the record holding 12, i >= 12.5 returns 12, i < 12.5 misses 12, and l = 1e19 returns Long.MAX_VALUE; openCypher n.i < 12.5 misses 12 since 179cf8dcdc #9021 and covered by Issue9021*, but it affects every BETWEEN on integer columns, so it deserves a line in the PR description.
  7. Stacked branch: the diff carries fix(#9021): an index on an integral key answers for the exact bound, not the truncated one #9126 and fix(#8995): openCypher allShortestPaths returns one path per parallel relationship #9120. Please rebase once those merge so the review surface is the four fixes only.

Conventions check

  • No new dependencies and no System.out left.
  • The timeout test uses StallAwareStopwatch.assertGaveUpWithin and @Tag("slow"), as CLAUDE.md asks.

Nothing here blocks the merge. Items 1 and 2 are the ones I would address first.

🤖 Generated with Claude Code

@codecov

codecov Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 78.01047% with 84 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.81%. Comparing base (50657bd) to head (433ffcb).
⚠️ Report is 81 commits behind head on main.

Files with missing lines Patch % Lines
...rcadedb/query/sql/executor/FetchFromIndexStep.java 50.00% 32 Missing and 16 partials ⚠️
...ry/opencypher/executor/steps/ShortestPathStep.java 89.83% 4 Missing and 8 partials ⚠️
...main/java/com/arcadedb/index/IntegralKeyBound.java 88.15% 2 Missing and 7 partials ⚠️
...java/com/arcadedb/query/select/SelectExecutor.java 74.19% 2 Missing and 6 partials ⚠️
...cadedb/query/sql/executor/DeleteFromIndexStep.java 86.48% 1 Missing and 4 partials ⚠️
...ncypher/executor/operators/NodeIndexRangeScan.java 88.23% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #9160      +/-   ##
============================================
+ Coverage     76.79%   76.81%   +0.01%     
  Complexity     3914     3914              
============================================
  Files          2121     2123       +2     
  Lines        211357   211724     +367     
  Branches      44788    44892     +104     
============================================
+ Hits         162317   162637     +320     
- Misses        31664    31672       +8     
- Partials      17376    17415      +39     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@claude

claude Bot commented Oct 4, 2026

Copy link
Copy Markdown

Review

I read the diff and the surrounding code. I did not run the tests, so my comments are from reading only. The unstacked changes (#9146, #9125, #9124, #9123) look correct and well tested. A few points are worth a look before merge.

Correctness and risk

  1. Lazy allShortestPaths enumeration versus write clauses (ShortestPathStep). Before this PR every path of an input row was built before the first row was emitted. Now paths are produced on demand, so a write clause downstream can run while the enumeration is still open. aWriteClauseAfterTheMatchDoesNotDisturbTheEnumeration only deletes relationships(p)[0], and each path has a different edge there. It does not cover a write that touches records shared by later paths, for example DELETE b or DETACH DELETE a. Resolved hops are cached, so later paths can still carry deleted vertices or edges. Please either add such a test and confirm the expected behaviour, or confirm that the planner puts an eager barrier before write clauses.
  2. Brittle assertion in CypherAllShortestPathsParallelEdgesIssue8995Test. hasStackTraceContaining("ShortestPathStep$1.fetchMore") depends on the anonymous class numbering. Adding another anonymous class to ShortestPathStep would break it without any behaviour change. Naming the iterator, or asserting on a stable marker, would be more robust.
  3. PathEnumerator frame bounds. I checked that vertices and hops are sized foundDepth + 1 and that a non-source child never reaches index foundDepth. It holds only because predecessors follows BFS layers exactly. A one-line comment saying so would help the next reader. The same logic serves both the plain and the filtered variant.

Design and style

  1. Duplicated bound-mapping logic. The "map inexact bound, then detect an empty range after mapping" logic now appears in NodeIndexRangeScan, DeleteFromIndexStep.processBetweenCondition and FetchFromIndexStep. It uses different empty-range checks in different places. For example DeleteFromIndexStep only checks lower > upper when one side was inexact, while NodeIndexRangeScan checks it whenever both bounds are exact numbers. A small helper in IntegralKeyBound, such as isEmptyRange(keyType, lower, upper), would keep the three call sites consistent. CLAUDE.md asks for reuse of existing components.
  2. DeleteFromIndexStep.orderAsc. createCursor now ignores orderAsc, with a comment saying why. The field and constructor parameter are still used by processBetweenCondition, so they stay. Please check that the planner does not rely on the old semantics for the one-sided operators.
  3. BigInteger (A BigInteger property value outside the long range is stored as a DOUBLE and reads back with its low digits changed, through Gremlin and through the Document API (12345678901234567890 comes back as 12345678901234567168) #9146). The bitLength() > 63 check is right, including Long.MIN_VALUE. A value now reads back as a Long or an Integer inside the long range and as a BigDecimal outside it. That means the stored type changes with the value, and the release note should say so. The same release note should cover the RETURN allShortestPaths(...) all-paths change that this PR inherits from fix(#8995): openCypher allShortestPaths returns one path per parallel relationship #9120.

Tests

  • Coverage is good: the new Issue9146*, Issue9125*, Issue9124* and Issue9123* tests cover the new paths, and the 9124 tests cover the two-level subtype chain and the sibling case.
  • A test of BETWEEN on an integral value with NaN or infinite bounds, through the plain SQL evaluator, would pin down the BetweenCondition change. That change now skips conversion for any Number bound.
  • The @Timeout(60) values on the streaming tests are fine as hang detectors, as the comment says.

Process

The PR is stacked on #9126 and #9120. Once those merge, the diff shrinks and it should be rebased and the tests re-run.

Overall: approve once point 1 is answered. The rest are nits or follow-ups.

@codacy-production

Copy link
Copy Markdown

Not up to standards ⛔

🔴 Issues 2 high · 2 minor

Alerts:
⚠ 4 issues (≤ 0 issues of at least minor severity)

Results:
4 new issues

Category Results
BestPractice 1 minor
ErrorProne 2 high
CodeStyle 1 minor

View in Codacy

🟢 Metrics 133 complexity

Metric Results
Complexity 133

View in Codacy

🟢 Coverage 89.27% diff coverage · -5.78% coverage variation

Metric Results
Coverage variation ✅ -5.78% coverage variation
Diff coverage ✅ 89.27% diff coverage

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (50657bd) 211357 179730 85.04%
Head commit (433ffcb) 244328 (+32971) 193648 (+13918) 79.26% (-5.78%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#9160) 382 341 89.27%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants