fix: inline relationship WHERE predicate is now applied#3953
Conversation
Inline predicates like [r:KNOWS WHERE r.since < 2019] were silently ignored because RelationshipPattern had no field for the expression, CypherASTBuilder never extracted ctx.expression(), and MatchRelationshipStep had no evaluation path for it. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
🟢 Coverage 100.00% diff coverage · -8.04% coverage variation
Metric Results Coverage variation ✅ -8.04% coverage variation Diff coverage ✅ 100.00% diff coverage Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (582167a) 118917 86638 72.86% Head commit (9ea3084) 150173 (+31256) 97336 (+10698) 64.82% (-8.04%) 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 (#3953) 21 21 100.00% 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. Give us feedback
There was a problem hiding this comment.
Code Review
This pull request implements support for inline WHERE predicates within OpenCypher relationship patterns by updating the AST, parser, and execution logic. While the core functionality is covered, feedback suggests that the optimized execution paths (fast path) may silently ignore these predicates, potentially leading to incorrect results. Additionally, there is a performance concern regarding the frequent allocation and property copying of ResultInternal objects during edge evaluation, which could be optimized to reduce overhead in large-scale graph traversals.
…ations canUseFastPath now returns false when the relationship pattern has an inline WHERE expression, preventing silent predicate skipping on the vertex-only traversal path. matchesEdgeWhereExpression now accepts a pre-populated ResultInternal built once per source vertex instead of allocating and copying on every edge traversal. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3953 +/- ##
==========================================
- Coverage 64.00% 63.87% -0.13%
==========================================
Files 1591 1591
Lines 118917 118934 +17
Branches 25271 25275 +4
==========================================
- Hits 76118 75975 -143
- Misses 32309 32487 +178
+ Partials 10490 10472 -18 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…o [skip ci] Bumps [marked](https://github.com/markedjs/marked) from 18.0.2 to 18.0.3. Release notes *Sourced from [marked's releases](https://github.com/markedjs/marked/releases).* > v18.0.3 > ------- > > [18.0.3](markedjs/marked@v18.0.2...v18.0.3) (2026-05-01) > ----------------------------------------------------------------------------------- > > ### Bug Fixes > > * avoid task checkbox for setext heading text ([#3960](https://redirect.github.com/markedjs/marked/issues/3960)) ([2608e81](markedjs/marked@2608e81)) Commits * [`e8dc395`](markedjs/marked@e8dc395) chore(release): 18.0.3 [skip ci] * [`2608e81`](markedjs/marked@2608e81) fix: avoid task checkbox for setext heading text ([#3960](https://redirect.github.com/markedjs/marked/issues/3960)) * [`dba76f6`](markedjs/marked@dba76f6) chore(deps-dev): bump eslint from 10.2.0 to 10.2.1 ([#3953](https://redirect.github.com/markedjs/marked/issues/3953)) * [`015f1eb`](markedjs/marked@015f1eb) chore(deps-dev): bump typescript from 6.0.2 to 6.0.3 ([#3954](https://redirect.github.com/markedjs/marked/issues/3954)) * [`17c06e9`](markedjs/marked@17c06e9) chore: fix building license for docs ([#3952](https://redirect.github.com/markedjs/marked/issues/3952)) * [`55a54b5`](markedjs/marked@55a54b5) chore: Rename LICENSE.md to LICENSE for better compatibility with Bazel tooli... * See full diff in [compare view](markedjs/marked@v18.0.2...v18.0.3) [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- Dependabot commands and options You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Summary
Fixes #3951
Inline relationship predicates like
[r:KNOWS WHERE r.since < 2019]were silently ignored, causing ArcadeDB to return rows that should have been filtered out.RelationshipPattern- addedwhereExpression: BooleanExpressionfield with accessorsCypherASTBuilder.visitRelationshipPattern()- now extractsctx.expression()and parses it into the new fieldMatchRelationshipStep- addedmatchesEdgeWhereExpression()that binds the relationship variable to a temporary result and evaluates the predicate before producing output rowsTest plan
OpenCypherPatternPredicateTest.InlineRelationshipPredicate#inlineWhereOnRelationshipIsApplied- undirected pattern, only the 2018 edge is returnedOpenCypherPatternPredicateTest.InlineRelationshipPredicate#inlineWhereOnRelationshipDirected- directed pattern, single row Alice->Bob:2018OpenCypherPatternPredicateTest.InlineRelationshipPredicate#inlineWhereWithExternalWhereClause- inline predicate combined with outer WHERE🤖 Generated with Claude Code