Skip to content

functions-and-operators: fix JSON_DEPTH() example path to match its own JSON document (#23865) - #23872

Open
ti-chi-bot wants to merge 1 commit into
pingcap:masterfrom
ti-chi-bot:cherry-pick-23865-to-master
Open

ti-chi-bot wants to merge 1 commit into
pingcap:masterfrom
ti-chi-bot:cherry-pick-23865-to-master

Conversation

@ti-chi-bot

@ti-chi-bot ti-chi-bot commented Sep 15, 2026

Copy link
Copy Markdown
Member

This is an automated cherry-pick of #23865

What is changed, added or deleted? (Required)

The JSON_DEPTH() example in functions-and-operators/json-functions/json-functions-return.md
lists three path levels — `$`, `$.weather`, and (labeled "weather
current") `$.weather.sunny`. But the actual JSON document used in the
example right below is {"weather": {"current": "sunny"}}, where "sunny"
is the value, not a key — the real third-level path is `$.weather.current`.

Fixes the path in the bullet list to match the document the example
actually queries. (Found while translating this file into Japanese; the
Japanese-side inconsistency this caused is fixed separately.)

Verified against a live TiDB instance (tiup playground, TiDB v8.5.x):

mysql> SELECT JSON_EXTRACT('{"weather": {"current": "sunny"}}', '$.weather.current') AS via_current,
              JSON_EXTRACT('{"weather": {"current": "sunny"}}', '$.weather.sunny') AS via_sunny;
+-------------+-----------+
| via_current | via_sunny |
+-------------+-----------+
| "sunny"     | NULL      |
+-------------+-----------+

$.weather.current correctly resolves to "sunny"; $.weather.sunny does
not exist in the document and returns NULL, confirming the path in the
bullet list was wrong.

Which TiDB version(s) do your changes apply to? (Required)

  • release-8.5 (TiDB 8.5 versions)

What is the related PR or file link(s)?

  • This PR is translated from:
  • Other reference link(s):

AI agent involvement

  • The changes in this PR were primarily made by an AI agent on behalf of the PR author.

Do your changes match any of the following descriptions?

  • Delete files
  • Change aliases
  • Need modification after applied to another branch
  • Might cause conflicts after applied to another branch

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Corrected the JSON_DEPTH() example path to match the accompanying JSON document and SQL query.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@ti-chi-bot ti-chi-bot added lgtm needs-1-more-lgtm Indicates a PR needs 1 more LGTM. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. type/cherry-pick-for-master This PR is cherry-picked to master from a source PR. labels Sep 15, 2026
@ti-chi-bot

ti-chi-bot Bot commented Sep 15, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign lance6716 for approval. For more information see the Code Review Process.
Please ensure that each of them provides their approval before proceeding.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@coderabbitai

coderabbitai Bot commented Sep 15, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 172c1dc0-0b33-4a6f-8caf-03cba62d0018

📥 Commits

Reviewing files that changed from the base of the PR and between eed05b5 and c243721.

📒 Files selected for processing (1)
  • functions-and-operators/json-functions/json-functions-return.md

Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

The JSON_DEPTH() example now uses $.weather.current, matching the path in the example JSON document and SQL query.

Changes

JSON function documentation

Layer / File(s) Summary
Correct JSON_DEPTH() example path
functions-and-operators/json-functions/json-functions-return.md
The example path changes from $.weather.sunny to $.weather.current.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~2 minutes

Change: Other

Merge Risk: ⚪ Minimal · up to c2437

The example now documents the JSON path used by its own JSON document, so it is ready to merge.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely identifies the documentation area and the specific JSON_DEPTH() path correction.
Description check ✅ Passed The description explains the change, the reason for the correction, the affected TiDB version, verification results, AI involvement, and applicable change categories. The version label uses release-8.…
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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

Labels

lgtm needs-1-more-lgtm Indicates a PR needs 1 more LGTM. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. type/cherry-pick-for-master This PR is cherry-picked to master from a source PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants