Skip to content

[MOD-19584] Expose computed JSONPath results through RedisJSON API - #1675

Open
TalBarYakar wants to merge 6 commits into
masterfrom
tal.ba/feat/MOD-19584-evaluate-local
Open

TalBarYakar wants to merge 6 commits into
masterfrom
tal.ba/feat/MOD-19584-evaluate-local

Conversation

@TalBarYakar

@TalBarYakar TalBarYakar commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Add evaluate to shared API V11 using the existing projection engine. Keep computed values owned by the iterator and release them with freeIter, while preserving existing node-only APIs.

Document ownership and lifetime rules and add Rust and C API tests.


Note

Medium Risk
Extends the stable C ABI and pointer/lifetime contract for iterators; mistakes in ownership or mixing get vs evaluate could affect downstream modules like RediSearch.

Overview
Adds RedisJSON shared C API v11 with a new evaluate entry point so module consumers can run JSONPath computed projections (arithmetic, sum(), first(), filters with expressions, etc.) the same way JSON.GET does, while get, pathParse, and getWithPath stay node-only and still reject projections.

The results iterator now carries either borrowed document nodes or owned computed values (via new Manager::import_value, with an IValue fast path). rejson_api.h documents iterator ownership, lifetime, and storage-format caveats for projections. Coverage includes Rust unit tests, LLAPI.EVALUATE in the pytest C consumer, and testLLAPIEvaluate.

Reviewed by Cursor Bugbot for commit e3ce62a. Bugbot is set up for automated code reviews on this repo. Configure here.

Add evaluate to shared API V11 using the existing projection engine.
Keep computed values owned by the iterator and release them with freeIter,
while preserving existing node-only APIs.

Document ownership and lifetime rules and add Rust and C API tests.
@TalBarYakar TalBarYakar self-assigned this Oct 15, 2026
@codecov

codecov Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.05556% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.28%. Comparing base (499b68f) to head (e3ce62a).

Files with missing lines Patch % Lines
redis_json/src/manager.rs 0.00% 3 Missing ⚠️
redis_json/src/c_api.rs 96.87% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1675      +/-   ##
==========================================
+ Coverage   88.26%   88.28%   +0.01%     
==========================================
  Files          17       17              
  Lines        6076     6128      +52     
==========================================
+ Hits         5363     5410      +47     
- Misses        713      718       +5     

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

Comment thread redis_json/src/c_api.rs

#[repr(C)]
struct ValueWrapper<V: SelectValue> {
value: *const V,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we check maybe we we can add M::O here and reuse this struct?

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants