Repository navigation
[MOD-17021] Add getWithPath LLAPI to evaluate a pre-compiled JSONPath - #1623
Merged
AvivDavid23 merged 6 commits intoJul 26, 2026
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1623 +/- ##
==========================================
+ Coverage 85.93% 85.97% +0.04%
==========================================
Files 15 15
Lines 5275 5305 +30
==========================================
+ Hits 4533 4561 +28
- Misses 742 744 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
AvivDavid23
requested changes
Jul 20, 2026
AvivDavid23
left a comment
Contributor
There was a problem hiding this comment.
LGTM. only thing ill add:
- Add the corresponding c API contract to
rejson_api.h - Fix linter errors(see CI)
- Can you also add a flow test that runs within
test_llapi.pyand checks a customllapi_test_module?
Rest of the CI errors are from the final uploading artifacts phase, you can ignore
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Reviewed by Cursor Bugbot for commit f29741d. Configure here.
Itzikvaknin
force-pushed
the
itzik-mod-16899-getwithpath-llapi
branch
from
July 20, 2026 11:46
5ae9d10 to
0802fca
Compare
Adds a V9 RedisJSON C API entry getWithPath(json, JSONPath) that evaluates an already-compiled path (from pathParse) instead of a path string, skipping the per-call pest compilation. Callers that resolve the same path across many documents (e.g. RediSearch FT.AGGREGATE LOAD) can compile once and reuse the handle. - c_api.rs: json_api_get_with_path + exported JSONAPI_getWithPath, struct/initializer entry, REDIS_JSONAPI_LATEST_API_VER 8->9; parity unit test (getWithPath == get). - include/rejson_api.h: getWithPath declaration + LATEST_API_VER bump. lib.rs: register the entrypoint. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Extend the llapi_test_module consumer with LLAPI.OPEN_GET_WITH_PATH (pathParse + getWithPath, via an open_and_get_with_path helper mirroring open_and_get, sharing reply_nodes_as_json with OPEN_GET) and assert in test_llapi.py that it matches LLAPI.OPEN_GET, plus missing-key / bad-path / projection error cases. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Itzikvaknin
force-pushed
the
itzik-mod-16899-getwithpath-llapi
branch
from
July 20, 2026 11:48
0802fca to
1bff237
Compare
AvivDavid23
previously approved these changes
Jul 20, 2026
Replace the debug_assert with 'if query.is_projection() { return null(); }' so a projection path is handled identically to the string-based json_api_get in all builds (not just debug), and defensively at the FFI boundary. Add a unit test passing a compiled projection Query directly.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
AvivDavid23
previously approved these changes
Jul 21, 2026
Drop the self-explanatory test doc comment and shorten the guard comment to a one-liner referencing json_api_get. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Co-Authored-By: Claude Opus 4.8 <[email protected]>
AvivDavid23
approved these changes
Jul 21, 2026
TalBarYakar
added a commit
that referenced
this pull request
Jul 27, 2026
* MOD-13014: redact user data from JSONPath trace logs (#1605) MOD-13014 removed user data from errors but left the JSONPath engine's trace logs, which still emitted document values, query literals and paths at Redis `debug` log level (trace! maps to RedisLogLevel::Debug). Gate those traces behind a cached mirror of Redis core's `hide-user-data-from-log` server config: a new `trace_user_data!` macro suppresses the message when the flag is on. The module reads the config at load and refreshes it on CONFIG SET via a config-changed event handler. Structural traces (grammar rules, "missing operand" diagnostics) stay on plain trace! and are unaffected. Co-authored-by: Claude Opus 4.8 <[email protected]> * remove `#[cfg(not(feature = "as-library"))]` from `sync_hide_user_dat… (#1613) * MOD-16366 json add flow tests to check llapi c api (#1614) * MOD-16366 LLAPI flow tests * remove `#[cfg(not(feature = "as-library"))]` from `sync_hide_user_data_from_log` * remove `#[cfg(not(feature = "as-library"))]` from `sync_hide_user_data_from_log` * fail if module not available * fixes * CR * . * CR * MOD-16514 - fix bootstrap & build for al os (#1612) * alma8 +rhel8+rhel9+bionic +focal passes * fix for alpine * fix for bionic * fix * fix mariner * fix bionic bootstrap * fix bionic * fix bionic * fi bionic * fix bionic * install aws cli for json * bionic fix * fix bionic * fix for focal * fix for focak * fix for bionic & focal &mariner&alpine * apply fixes * fix remarks * fix for alpine * try another methood * ci: source $HOME/.cargo/env in flow-clippy so cargo is on PATH Match flow-linter.yml; getrust.sh now installs Rust user-scoped, so later Actions steps don't see cargo without sourcing the env. * CI was failing because getrust.sh ran twice. install_script.sh already invokes it from the repo root (works), but the workflow then called ./getrust.sh sudo again from working-directory: .install — where rust-toolchain.toml doesn't exist, so its `sed rust-toolchain.toml` errored with "No such file or directory" (exit 2). Removed the redundant ./getrust.sh line from flow-linter.yml and flow-clippy.yml; install_script.sh handles Rust install on its own. * ci(macos): add rust-toolchain.toml to sparse checkout The macOS "Deps checkout" fetches only .install and test requirements, then runs install_script.sh -> getrust.sh, which reads rust-toolchain.toml from the repo root to resolve the pinned toolchain. That file wasn't in the sparse list, so getrust failed with "sed: rust-toolchain.toml: No such file or directory". Add it to the sparse-checkout. * MOD-16300 perf(json_path): materialize filter literals once per query (#1615) * MOD-16300 perf(json_path): materialize filter literals once per query * simplify * CR + Reuse cache in whole query * MOD-16608 Bump ijson(reduce object memory) (#1617) * MOD-16608 Bump ijson(reduce object memory) * clippy * fix memory test * MOD-16274 | MOD-16275 add size/sizeof and empty operators on object (#1618) * MOD-16685 Add RedisJSON API to open from RedisModuleKey (#1619) * MOD-16685 Add RedisJSON API to open from RedisModuleKey Add a RedisJSON shared API V8 entry that opens a JSON root from an already-open RedisModuleKey handle. This lets consumers such as RediSearch reuse an existing key handle instead of manually checking isJSON and calling RedisModule_ModuleTypeGetValue. Update the RediSearch RedisJSON API header copy and add LLAPI coverage for the new openKeyFromHandle path. * use Imanager to get value for json * fix clippy * rename functions * fix compilation * MOD-16872 make `apply_updates` return the current status of updates (#1621) * add docker image managment to json (#1622) * Add `AGENTS.md` and `CLAUDE.md` * ignore AGENS.MD in spellcheck * ignore CLAUDE.MD in spellcheck * [MOD-17021] Add getWithPath LLAPI to evaluate a pre-compiled JSONPath (#1623) * MOD-16899: add getWithPath LLAPI to evaluate a pre-compiled JSONPath Adds a V9 RedisJSON C API entry getWithPath(json, JSONPath) that evaluates an already-compiled path (from pathParse) instead of a path string, skipping the per-call pest compilation. Callers that resolve the same path across many documents (e.g. RediSearch FT.AGGREGATE LOAD) can compile once and reuse the handle. - c_api.rs: json_api_get_with_path + exported JSONAPI_getWithPath, struct/initializer entry, REDIS_JSONAPI_LATEST_API_VER 8->9; parity unit test (getWithPath == get). - include/rejson_api.h: getWithPath declaration + LATEST_API_VER bump. lib.rs: register the entrypoint. Co-Authored-By: Claude Opus 4.8 <[email protected]> * MOD-16899: add LLAPI flow test for getWithPath Extend the llapi_test_module consumer with LLAPI.OPEN_GET_WITH_PATH (pathParse + getWithPath, via an open_and_get_with_path helper mirroring open_and_get, sharing reply_nodes_as_json with OPEN_GET) and assert in test_llapi.py that it matches LLAPI.OPEN_GET, plus missing-key / bad-path / projection error cases. Co-Authored-By: Claude Opus 4.8 <[email protected]> * getWithPath: reject projections at runtime like json_api_get Replace the debug_assert with 'if query.is_projection() { return null(); }' so a projection path is handled identically to the string-based json_api_get in all builds (not just debug), and defensively at the FFI boundary. Add a unit test passing a compiled projection Query directly. Co-Authored-By: Claude Opus 4.8 <[email protected]> * getWithPath: trim projection comments Drop the self-explanatory test doc comment and shorten the guard comment to a one-liner referencing json_api_get. Co-Authored-By: Claude Opus 4.8 <[email protected]> * getWithPath: drop json_api_get reference from projection guard comment Co-Authored-By: Claude Opus 4.8 <[email protected]> --------- Co-authored-by: Claude Opus 4.8 <[email protected]> * MOD-16952 - enhance bootstrap (add list and dry-run arg) (#1624) * enhance bootstrap - add check-deps * write list to afile * add optional deps * add another optional deps * add another optional deps * add versioning managment * rename command to list * renme to list * add dry run * fix colors * fix missing uv * remove min cmake version * fix remarks * add the retry mechanizm to json as well * fix remarks * fix remarks * add _sh so we can have the full bootstrap output * always return to the workspace dir * make single copy paste install all * fix alma8 * fix bad dry-run print * gaurd tool-set version 11 * fix curl minimal * remove centos-release-scl for amazonlinux2 * fix macos env * fix(bootstrap): make sudo a no-op on root containers without a sudo binary The install scripts run privileged steps via literal `sudo` inside `_sh` command strings (e.g. `sudo ln -sf ...`, `| sudo tee`, `&& sudo make install`). On a slim Docker image that runs install_script.sh directly as root with no `sudo` package installed (e.g. RedisTimeSeries' amazonlinux2 CI), those steps fail with `sudo: command not found` (exit 127), aborting the whole bootstrap. Add a root-only pass-through in pm.sh/deps_lib.sh: when running as root and no real `sudo` binary exists, define `sudo()` to run its arguments directly. When not root, a missing sudo stays a genuine error and is left unmasked. * version update * Revert "[MOD-17021] Add getWithPath LLAPI to evaluate a pre-compiled JSONPath (#1623)" This reverts commit 628013e. --------- Co-authored-by: Tom Gabsow <[email protected]> Co-authored-by: Claude Opus 4.8 <[email protected]> Co-authored-by: Aviv David <[email protected]> Co-authored-by: avivdavid23 <[email protected]> Co-authored-by: Itzikvaknin <[email protected]>
3 tasks
YaacovHazan
pushed a commit
to redis/redis
that referenced
this pull request
Jul 29, 2026
## Module Update This PR bumps the pinned **MODULE_VERSION** for **RedisJSON** from **v8.9.90** to **v8.10.0**. RedisBloom and RedisTimeSeries are unchanged. ## Changes | Module | From | To | | -- | -- | -- | | RedisJSON | v8.9.90 | v8.10.0 | **Note:** this RedisJSON range contains 6 relevant commits. The main changes are apply_updates status reporting, Docker image management, bootstrap list / dry-run support, and agent guidance / spellcheck updates. ## Module Changes [RedisJSON range](RedisJSON/RedisJSON@v8.9.90...v8.10.0) - MOD-16872 — make `apply_updates` return the current update status instead of only applying changes, with pytest and CI updates ([#1621](RedisJSON/RedisJSON#1621)) - No ticket — add Docker image management for RedisJSON CI/release flows, including Docker image push workflow wiring ([#1622](RedisJSON/RedisJSON#1622)) - No ticket — add `AGENTS.md` and `CLAUDE.md` repo guidance files - No ticket — ignore `AGENTS.md` in spellcheck - No ticket — ignore `CLAUDE.md` in spellcheck - MOD-16952 — enhance bootstrap with dependency listing, dry-run support, retry handling, optional dependency handling, and root-without-sudo support for slim containers ([#1624](RedisJSON/RedisJSON#1624)) ## Excluded Commits **1 commit excluded** MOD-17021 / [#1623](RedisJSON/RedisJSON#1623) is intentionally excluded from this description. ## Verification - [ ] CI passes for RedisJSON at the new pinned version - [ ] `make all` builds RedisJSON cleanly against unstable - [ ] Module tests run under `make test` --- *This PR was automatically created by the Redis Module Release Orchestrator.* <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Single manifest pin bump with no Redis core or load-path changes; risk is limited to RedisJSON module behavior at the new upstream release. > > **Overview** > Pins **RedisJSON** in `modules/modules.yaml` from **v8.9.90** to **v8.10.0**; RedisBloom, RediSearch, and RedisTimeSeries refs are unchanged. > > After merge, `make modules-update redisjson` (or a full modules refresh) will pull the new tag for `modules/redisjson/src/` and rebuild **`rejson.so`** per the existing manifest wiring. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 27f5ca7. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
This was referenced Aug 9, 2026
4 tasks
2 of 4 tasks
AvivDavid23
pushed a commit
that referenced
this pull request
Nov 11, 2026
…1693) * [MOD-17021] Add getWithPath LLAPI to evaluate a pre-compiled JSONPath (#1623) * MOD-16899: add getWithPath LLAPI to evaluate a pre-compiled JSONPath Adds a V9 RedisJSON C API entry getWithPath(json, JSONPath) that evaluates an already-compiled path (from pathParse) instead of a path string, skipping the per-call pest compilation. Callers that resolve the same path across many documents (e.g. RediSearch FT.AGGREGATE LOAD) can compile once and reuse the handle. - c_api.rs: json_api_get_with_path + exported JSONAPI_getWithPath, struct/initializer entry, REDIS_JSONAPI_LATEST_API_VER 8->9; parity unit test (getWithPath == get). - include/rejson_api.h: getWithPath declaration + LATEST_API_VER bump. lib.rs: register the entrypoint. Co-Authored-By: Claude Opus 4.8 <[email protected]> * MOD-16899: add LLAPI flow test for getWithPath Extend the llapi_test_module consumer with LLAPI.OPEN_GET_WITH_PATH (pathParse + getWithPath, via an open_and_get_with_path helper mirroring open_and_get, sharing reply_nodes_as_json with OPEN_GET) and assert in test_llapi.py that it matches LLAPI.OPEN_GET, plus missing-key / bad-path / projection error cases. Co-Authored-By: Claude Opus 4.8 <[email protected]> * getWithPath: reject projections at runtime like json_api_get Replace the debug_assert with 'if query.is_projection() { return null(); }' so a projection path is handled identically to the string-based json_api_get in all builds (not just debug), and defensively at the FFI boundary. Add a unit test passing a compiled projection Query directly. Co-Authored-By: Claude Opus 4.8 <[email protected]> * getWithPath: trim projection comments Drop the self-explanatory test doc comment and shorten the guard comment to a one-liner referencing json_api_get. Co-Authored-By: Claude Opus 4.8 <[email protected]> * getWithPath: drop json_api_get reference from projection guard comment Co-Authored-By: Claude Opus 4.8 <[email protected]> --------- Co-authored-by: Claude Opus 4.8 <[email protected]> (cherry picked from commit 628013e) * [MOD-19414] Add pathParseNoErrorMsg to the RedisJSON LLAPI (V10) (#1666) (cherry picked from commit 4635c87) * Drop unused get_llapi_ctx import that fails clippy on 8.10 Since the pre-command hook became optional, export_shared_api! imports get_llapi_ctx itself, so the top-level import is unused and `cargo clippy -- -D warnings` fails on 8.10. Matches master. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 4.8 <[email protected]> Co-authored-by: Dimitar Kyurtov <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

Describe the changes in the pull request
pathParse→JSONPathhandle) and inspect it (pathIsSingle/pathHasDefinedOrder), but the only way to evaluate a path against a document isget(json, const char *path), which re-runsjson_path::compile(the pest parser — parsing + validation, the dominant cost) on every call.getWithPath(json, JSONPath)that evaluates an already-compiledpathParsehandle and skips straight toPathCalculator::calc. Purely additive;LATEST_API_VER8 → 9.LOADover JSON) compile once and reuse the handle instead of re-parsing per doc/field. Local repro: a groupby-collect query went ~505 → ~160 ms (~3.1×), identical output; ~6× faster per call in a micro-benchmark.Which additional issues this PR fixes
Main objects this PR modified
redis_json/src/c_api.rs— newjson_api_get_with_path+ exportedJSONAPI_getWithPath, struct/initializer entry,LATEST_API_VERbumpredis_json/src/lib.rs— register the new entrypointMark if applicable
Release Notes
New LLAPI
getWithPathto evaluate a pre-compiled JSONPath, avoiding repeated path parsing for callers that reuse the same path (e.g. RediSearch JSONLOAD).Note
Low Risk
Additive C ABI extension with behavior aligned to existing get; main caller risk is misuse of non-Sync compiled path handles across threads.
Overview
Adds RedisJSON LLAPI v9 with
getWithPath, which evaluates a document against apathParsehandle instead of re-parsing the path on everygetcall.LATEST_API_VERmoves 8 → 9; existing entry points are unchanged.Implementation mirrors
json_api_getafter compile: it runsPathCalculator::calcand returns the same results iterator shape. Projection paths still return null (same rule as stringget). Docs note the compiledQueryis borrowed and is notSync, so callers must not evaluate the same handle concurrently from multiple threads.rejson_api.h, the exportedRedisJSONAPIstruct, andlib.rswire upJSONAPI_getWithPath. The LLAPI test module gainsLLAPI.OPEN_GET_WITH_PATH(with shared reply helper refactor), plus Rust and Python tests that assert parity withOPEN_GETand error paths.Reviewed by Cursor Bugbot for commit 85ad11e. Bugbot is set up for automated code reviews on this repo. Configure here.