GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: #9146 #9125 #9124 #9123 BigInteger precision, index delete bounds, r:R subtypes, streaming allShortestPaths by lvca · Pull Request #9160 · ArcadeData/arcadedb

Conversation

@lvca

@lvca lvca commented Oct 4, 2026 •
edited by coderabbitai Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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

  • 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: a BigInteger outside the long range written to an undeclared property is stored as an exact DECIMAL instead of being rounded to a DOUBLE (in-range values keep narrowing to Integer/Long).
  • DELETE FROM index:... WHERE key BETWEEN truncates a fractional bound on an integral key (follow-up of #9021) #9125: DELETE FROM INDEX:... WHERE key ... maps a fractional or out-of-range bound onto the integral key that bounds the same keys (reuses IntegralKeyBound). Two bugs in the same step turned up and are fixed: it never removed an entry (nested key array passed to index.remove), and =, <, <= removed the wrong key ranges.
  • openCypher: WHERE r:R ignores relationship subtypes while the pattern [r:R] includes them #9124: WHERE r:R on a relationship is polymorphic like the pattern [r:R].
  • openCypher MATCH p = allShortestPaths(...) materializes every path before emitting the first row #9123: MATCH p = allShortestPaths(...) produces its paths on demand (explicit-stack iterator), so LIMIT and streaming consumers stop the enumeration and the path list is bounded by the batch (the BFS distance and predecessor maps still grow with the visited vertices). The RETURN allShortestPaths(...) expression still materializes.

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
robfrank and others added 7 commits October 3, 2026 23:58
@robfrank @claude @lvca
fix(#9021): an index on an integral key answers for the exact bound, …
e54f8cb
…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]>
@robfrank @claude @lvca
fix(#8995): allShortestPaths returns one path per parallel relationship
731ec98
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]>
@robfrank @claude @lvca
address review: guard and memoize allShortestPaths back-tracking, exp…
d0ab992
…ression timeout, self-pair and hop-bound tests

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@robfrank @claude @lvca
address review: throttle the enumeration guard, pin it with a paralle…
345e3b7
…l-chain timeout test, diamond with a parallel pair

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@robfrank @claude @lvca
address review: 100 ms enumeration-timeout fixture, shared direction …
bf583fd
…arrays, shorter comment

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@robfrank @claude @lvca
address review: direction constants at the top of ShortestPathStep (C…
6660b63
…odacy)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@lvca
fix: BigInteger kept exact outside the long range (#9146), DELETE FRO…
1782b87
…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 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

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
  • X
  • Mastodon
  • Reddit
  • LinkedIn

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mergify

mergify Bot commented Oct 4, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@codacy-production

codacy-production Bot commented Oct 4, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@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

  • BinaryTypes (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): an out-of-range BigInteger round-trips as BigDecimal (the test asserts this) while the in-memory document keeps the BigInteger until reloaded. Fine, but worth a short note in the Javadoc. A one-line comment that Long.MIN_VALUE has bitLength() == 63 would also explain the > 63 threshold.
  • DeleteFromIndexStep.createCursor now ignores orderAsc, while processBetweenCondition still uses isOrderAsc(). Correct for a delete, but a short comment saying order is irrelevant would remove the inconsistency.
  • checkPathEnumeration uses Thread.interrupted(), which clears the flag before throwing. If that does not match the existing pattern in the class, restore the flag.
  • Tests: it would be good to add a case where the command deadline expires mid-enumeration on the lazy path (guard.check() every 1024 paths is new behavior), and an r:R case with a two-level subtype chain.

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@lvca
review round 1: guard non-numeric BETWEEN bounds, comments, write-aft…
b15698d
…er-match and two-level subtype tests
@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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@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

  • 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: bitLength() > 63 is the right boundary (Long.MIN_VALUE has bitLength 63), and the test covers both edges (Long.MIN/MAX and -2^63-1, 2^63) plus a 60-digit value. The serializeValue change is minimal.
  • openCypher: WHERE r:R ignores relationship subtypes while the pattern [r:R] includes them #9124: edgeType.instanceOf(label) hoisted out of the loop, consistent with the [r:R] pattern. Sibling and two-level tests are present.
  • DELETE FROM index:... WHERE key BETWEEN truncates a fractional bound on an integral key (follow-up of #9021) #9125: removing the nested new Object[]{entry.getFirst()} and bounding each operator on its own side fixes two real latent bugs. Tests cover =, <, >, BETWEEN, parameters and out-of-range bounds.
  • openCypher MATCH p = allShortestPaths(...) materializes every path before emitting the first row #9123: the explicit-stack PathEnumerator is clean. Hops are cached per vertex so work is proportional to hops, and the deadline is polled every 1024 paths. Using @Timeout only as a hang detector matches the CLAUDE.md guidance on wall-clock assertions. Sharing the OUT_ONLY/IN_ONLY/OUT_IN arrays removes a per-expansion allocation.

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):
    • openCypher MATCH p = allShortestPaths(...) materializes every path before emitting the first row #9123: laziness is proven only via the 60s timeout on a 16.7M-path graph. That is acceptable, but a deterministic check (e.g. LIMIT 1 followed by asserting the iterator was not drained, or a hop-resolution counter) would fail faster and more clearly if it regresses.
    • DELETE FROM index:... WHERE key BETWEEN truncates a fractional bound on an integral key (follow-up of #9021) #9125: no test for descending-order or composite-index DELETE FROM INDEX, and no <=/>= case with a fractional bound at the key-type extremes (e.g. Integer.MAX_VALUE + 0.5 on an INTEGER key).
    • 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: no reopen-database round trip, though the read goes through lookupByRID so this is low risk.

Process

  • Stacked on 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, so the diff mixes four fixes with two earlier ones; fine as stated, but this should merge after them.
  • I did not run the tests locally; the PR reports 6506 engine tests green in the affected packages.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@lvca
review round 2: final operand in createCursor, key-range-edge delete …
f9ccc54
…test
@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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@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

  • Good coverage: sibling and two-level subtype cases for openCypher: WHERE r:R ignores relationship subtypes while the pattern [r:R] includes them #9124, lazy enumeration plus write-clause interplay for openCypher MATCH p = allShortestPaths(...) materializes every path before emitting the first row #9123, and @Timeout used as a hang detector rather than a latency assertion, which matches the CLAUDE.md guidance.
  • Possibly missing: (a) DELETE FROM INDEX on a composite index with an inexact bound on the leading/range slot, since FetchFromIndexStep has explicit prefix handling that DeleteFromIndexStep does not; (b) a descending-order (ORDER BY ... DESC) case through FetchFromIndexStep with a mapped bound, since the inclusion flags are swapped in the !orderAsc branch; (c) BETWEEN on a Short/Byte column with fractional bounds (the BetweenCondition change covers all four integral classes).

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@lvca
review round 3: braces around the TYPE_DECIMAL case
343f09f
@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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@codecov

codecov Bot commented Oct 4, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

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.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@lvca
Merge main into fix/9146-9125-9124-9123
433ffcb
@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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@lvca
lvca merged commit 1b1ae3e into main Oct 4, 2026
@lvca
lvca deleted the fix/9146-9125-9124-9123 branch October 4, 2026 13:59
This was referenced Oct 4, 2026
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
Closed
DELETE FROM index:... WHERE key BETWEEN truncates a fractional bound on an integral key (follow-up of #9021) #9125
Closed
This was referenced Oct 4, 2026
openCypher: WHERE r:R ignores relationship subtypes while the pattern [r:R] includes them #9124
Closed
openCypher MATCH p = allShortestPaths(...) materializes every path before emitting the first row #9123
Closed
robfrank added a commit that referenced this pull request Oct 4, 2026
@robfrank @claude
Merge origin/main into fix/9021 (main carries the original #9021 comm…
9c3e515
…it via #9160)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Oct 4, 2026
fix(#9021): an index on an integral key answers for the exact bound, not the truncated one #9126
Merged
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
Closed
@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

🟢 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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@lvca lvca

Labels

None yet

Projects

None yet

Milestone

26.10.1

Development

Successfully merging this pull request may close these issues.

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)

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@lvca @robfrank
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.