Skip to content

refactor(functions): Optimize jq function performance#19946

Merged
b41sh merged 1 commit into
databendlabs:mainfrom
b41sh:feat-new-jq
Jun 16, 2026
Merged

refactor(functions): Optimize jq function performance#19946
b41sh merged 1 commit into
databendlabs:mainfrom
b41sh:feat-new-jq

Conversation

@b41sh

@b41sh b41sh commented Jun 2, 2026

Copy link
Copy Markdown
Member

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

This PR introduces a significant performance optimization for the jq function when working with jsonb data. Previously, invoking the jq function required an additional conversion step where jsonb data had to be transformed into serde_json::Value. After the execution of the jq function, another conversion was necessary to convert the result back into jsonb. This overhead not only added complexity but also resulted in suboptimal performance.

Changes

  • Eliminated the need for converting jsonb to serde_json::Value executing the jq function.
  • Enabled direct execution of the jq function on jsonb data, thus avoiding the extra conversion steps.

fixes: #[Link the issue here]

Tests

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test - Explain why

Type of change

  • Bug Fix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • Breaking Change (fix or feature that could cause existing functionality not to work as expected)
  • Documentation Update
  • Refactoring
  • Performance Improvement
  • Other (please describe):

This change is Reviewable

@github-actions github-actions Bot added the pr-refactor this PR changes the code base without new features or bugfix label Jun 2, 2026
@b41sh b41sh marked this pull request as ready for review June 16, 2026 02:36
@b41sh b41sh requested a review from sundy-li June 16, 2026 02:36

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 78557f8ab7

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/query/functions/src/srfs/variant.rs
@b41sh b41sh added this pull request to the merge queue Jun 16, 2026
Merged via the queue into databendlabs:main with commit bcce677 Jun 16, 2026
94 checks passed
@b41sh b41sh deleted the feat-new-jq branch June 16, 2026 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-refactor this PR changes the code base without new features or bugfix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants