Skip to content

chore: add an initial internal sql-json-path query implementation#7620

Draft
sunng87 wants to merge 4 commits intoGreptimeTeam:mainfrom
sunng87:feature/sql-json-path
Draft

chore: add an initial internal sql-json-path query implementation#7620
sunng87 wants to merge 4 commits intoGreptimeTeam:mainfrom
sunng87:feature/sql-json-path

Conversation

@sunng87
Copy link
Copy Markdown
Member

@sunng87 sunng87 commented Jan 27, 2026

I hereby agree to the terms of the GreptimeDB CLA.

Refer to a related PR or issue link (optional)

What's changed and what's your intention?

This patch uses sql-json-path to implement an early version of sql-json-path query on our current json data. We will keep improve this for the upcoming json data structures.

The sql-json-path query language is from postgres. More information: https://github.com/obartunov/sqljsondoc/blob/master/jsonpath.md

See sqlness files in the changeset for some details.

I'm not going to include this in our docs until our new json data structure is available. And we will need more effort to port this on it.

PR Checklist

Please convert it to a draft if some of the following conditions are not met.

  • I have written the necessary rustdoc comments.
  • I have added the necessary unit tests and integration tests.
  • This PR requires documentation updates.
  • API changes are backward compatible.
  • Schema or data changes are backward compatible.

@sunng87 sunng87 requested a review from a team as a code owner January 27, 2026 08:08
@github-actions github-actions bot added size/S docs-not-required This change does not impact docs. labels Jan 27, 2026
Copy link
Copy Markdown
Member

@killme2008 killme2008 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
Collaborator

@MichaelScofield MichaelScofield left a comment

Choose a reason for hiding this comment

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

We have already used the jsonpath-rust for querying inside json data, why introduce another one?

DataFusionError::Execution(format!("invalid jsonb binary: {e}"))
})?;
let mut json_str = jsonb_value.to_string();
let json_value: simd_json::OwnedValue = unsafe {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nit: best if we can unify the json string deserialization. Currently we have both serde_json and simd_json.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@sunng87 PTAL

@sunng87 sunng87 marked this pull request as draft March 18, 2026 03:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs-not-required This change does not impact docs. size/S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants