Implement JSON Path parser and related routines#9062
Open
Noremos wants to merge 7 commits into
Open
Conversation
added 7 commits
June 15, 2026 09:40
In docker build, the src is not available. So store it in temp dir and then try to copy to the src/jrd/json dir
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.
Full JSON support introduces a large number of changes, so it was decided to split the work into several smaller PRs to simplify the review process.
Original issue: #5431
The current plan is as follows:
The physical JSON type is the most interesting part of the implementation, but also the most complex from the engine perspective.
As described in the proposal, it is a simple structure that encapsulates either a VARCHAR or a BLOB value:
The idea is to use this type as the foundation for storing unlimited data types, such as JSON and spatial data.
However, this approach requires extensive discussion, and given the FB6 release schedule, there will likely not be enough time to include it.
As a fallback, BLOB can be used as the physical storage type. In FB7, it can be converted to FB_INLINE_BLOB_t during backup-restore.
This PR contains the implementation of JSON Path parsing and related routines
See doc/sql.extensions/README.json.md for additional details.
The current implementation aims to remain as close to the SQL standard as possible, with the following changes:
Support negative indexes in array range:
Standard:
[last - 4]Proposed extension:
[-5]Extended like_regex syntax
Standard:
<JSON like_regex pattern> ::= <string literal>Proposed extension:
<JSON like_regex pattern> ::= <string literal> | <JSON path>Do not use arithmetic operations in the input arguments of
like_regexandSTARTS WITH.Expressions such as
$.value + $passing STARTS WITH 'hello'are invalid: arithmetic operations apply only to numeric values, whilelike_regexandSTARTS WITHoperate exclusively on strings. Additionally, such constructs confuse the parserDo not allow path accessors after methods since they return a scalar (except
keyvalue())