Skip to content

cherrypick: json functions - #24670

Merged
mergify[bot] merged 9 commits into
matrixorigin:4.0-devfrom
daviszhen:0528-pickto4.0-c2f7c7d
May 29, 2026
Merged

mergify[bot] merged 9 commits into
matrixorigin:4.0-devfrom
daviszhen:0528-pickto4.0-c2f7c7d

Conversation

@daviszhen

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

issue ##24481

What this PR does / why we need it:

补充函数

JSON_ARRAY   
JSON_OBJECT 
JSON_TYPE     
JSON_VALID    
JSON_LENGTH    
JSON_KEYS            
JSON_PRETTY          
JSON_SCHEMA_VALID       
JSON_SCHEMA_VALID_REPORT 
JSON_VALUE             

@daviszhen
daviszhen requested a review from a user May 28, 2026 08:30
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@matrix-meow matrix-meow added the size/XXL Denotes a PR that changes 2000+ lines label May 28, 2026

@XuPeng-SH XuPeng-SH left a comment

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.

Re-checked against the current 4.0-dev base: I still do not think this PR is ready to approve.

The main blocker is no longer just cherry-pick cleanliness. The PR is also replacing behavior that already exists in 4.0-dev:

  • it rewrites the existing JSON_ARRAY / JSON_OBJECT implementation from the current JqEncoder-based path to the new bytejson.CreateByteJSON path
  • it tightens JSON_ARRAY / JSON_OBJECT type checking in list_builtIn.go, so inputs that previously bound successfully can now fail at bind time
  • the changed baselines in test/distributed/cases/function/func_arrayagg.result confirm observable output changes for existing queries (for example salary / avg_salary formatting)

Even if some of those result changes are arguably better or closer to MySQL, that still means this PR is not just adding missing JSON functions anymore. It is changing already-shipping 4.0-dev behavior and bundling an unrelated planner alias change (pow -> power) and its new binder test on top.

Please split / re-cherry-pick this so the PR only contains the intended missing-function backport, or explicitly scope and validate the JSON_ARRAY / JSON_OBJECT behavior replacement as a separate change.

@XuPeng-SH XuPeng-SH left a comment

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.

Re-reviewed after taking the pow->power alias out of the blocker set.

I focused on the remaining risk around JSON_ARRAY / JSON_OBJECT behavior replacement and did not find a blocker after the second pass. The JSON-related tests added in this PR are broad, the targeted Go package tests pass with -race, and the visible result changes look intentional and internally consistent with the new bytejson-based representation.

Approve.

@mergify

mergify Bot commented May 29, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-05-29 07:10 UTC · Rule: release-4.0
  • ✅ Checks skipped · PR is already up-to-date
  • ✅ Merged — 2026-05-29 07:11 UTC · at 86843b4fe8f7711ba85ec15dbf3f786c4c8a8f92 · squash

This pull request spent 26 seconds in the queue, including 4 seconds running CI.

Required conditions to merge
  • #approved-reviews-by >= 1 [🛡 GitHub branch protection]
  • #review-threads-unresolved = 0 [🛡 GitHub branch protection]
  • github-review-decision = APPROVED [🛡 GitHub branch protection]
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Compose CI / multi cn e2e bvt test docker compose(PESSIMISTIC)
    • check-neutral = Matrixone Compose CI / multi cn e2e bvt test docker compose(PESSIMISTIC)
    • check-skipped = Matrixone Compose CI / multi cn e2e bvt test docker compose(PESSIMISTIC)
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Standlone CI / Multi-CN e2e BVT Test on Linux/x64(LAUNCH, PROXY)
    • check-neutral = Matrixone Standlone CI / Multi-CN e2e BVT Test on Linux/x64(LAUNCH, PROXY)
    • check-skipped = Matrixone Standlone CI / Multi-CN e2e BVT Test on Linux/x64(LAUNCH, PROXY)
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Standlone CI / e2e BVT Test on Linux/x64(LAUNCH, PESSIMISTIC)
    • check-neutral = Matrixone Standlone CI / e2e BVT Test on Linux/x64(LAUNCH, PESSIMISTIC)
    • check-skipped = Matrixone Standlone CI / e2e BVT Test on Linux/x64(LAUNCH, PESSIMISTIC)
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone CI / SCA Test on Ubuntu/x86
    • check-neutral = Matrixone CI / SCA Test on Ubuntu/x86
    • check-skipped = Matrixone CI / SCA Test on Ubuntu/x86
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Compose CI / multi cn e2e bvt test docker compose(Optimistic/PUSH)
    • check-neutral = Matrixone Compose CI / multi cn e2e bvt test docker compose(Optimistic/PUSH)
    • check-skipped = Matrixone Compose CI / multi cn e2e bvt test docker compose(Optimistic/PUSH)
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Standlone CI / e2e BVT Test on Linux/x64(LAUNCH,Optimistic)
    • check-neutral = Matrixone Standlone CI / e2e BVT Test on Linux/x64(LAUNCH,Optimistic)
    • check-skipped = Matrixone Standlone CI / e2e BVT Test on Linux/x64(LAUNCH,Optimistic)
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Upgrade CI / Compatibility Test With Target on Linux/x64(LAUNCH)
    • check-neutral = Matrixone Upgrade CI / Compatibility Test With Target on Linux/x64(LAUNCH)
    • check-skipped = Matrixone Upgrade CI / Compatibility Test With Target on Linux/x64(LAUNCH)
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Utils CI / Coverage
    • check-neutral = Matrixone Utils CI / Coverage
    • check-skipped = Matrixone Utils CI / Coverage
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone CI / UT Test on Ubuntu/x86
    • check-neutral = Matrixone CI / UT Test on Ubuntu/x86
    • check-skipped = Matrixone CI / UT Test on Ubuntu/x86

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/enhancement size/XXL Denotes a PR that changes 2000+ lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants