Skip to content

[doc](be) Document JSONB path compatibility#63364

Draft
mrhhsg wants to merge 2 commits into
apache:masterfrom
mrhhsg:codex/fix-jsonb-path-validation
Draft

[doc](be) Document JSONB path compatibility#63364
mrhhsg wants to merge 2 commits into
apache:masterfrom
mrhhsg:codex/fix-jsonb-path-validation

Conversation

@mrhhsg
Copy link
Copy Markdown
Member

@mrhhsg mrhhsg commented May 18, 2026

What problem does this PR solve?

Related PR: None

Problem Summary: JSONB paths such as $[1.5], $[Last], $[LAST], and $.[0] are accepted even though they differ from stricter MySQL-style path syntax. After evaluation, these forms are treated as existing Doris JSONB compatibility behavior/feature because rejecting them would be a behavior change and could impact existing users. This PR keeps the current behavior and adds comments to document the intentional compatibility.

Release note

None

Check List (For Author)

  • Test:
    • No need to test (comment-only compatibility documentation; no runtime behavior change)
  • Behavior changed: No
  • Does this need documentation: No

### What problem does this PR solve?

Issue Number: DORIS-25580

Related PR: None

Problem Summary: Reject JSONB paths with fractional array indexes, case-mismatched last keyword, and dot-bracket array syntax so invalid paths fail instead of returning silent values.

### Release note

Reject invalid JSONB path expressions that were previously accepted silently.

### Check List (For Author)

- Test:
    - Unit Test: ./run-be-ut.sh --run --filter=JsonbPathTest.*
    - Regression test: ~/.codex/skills/doris-local-regression/scripts/doris-local-regression.sh run -d jsonb_p0 -s test_jsonb_invalid_path_syntax
    - Manual test: ./build.sh --be
- Behavior changed: Yes. Invalid JSONB path expressions now return an error.
- Does this need documentation: No
@hello-stephen
Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

### What problem does this PR solve?

Issue Number: DORIS-25580

Related PR: apache#63364

Problem Summary: Keep the existing JSONB path compatibility behavior for dot-array paths, case-insensitive last, and numeric-prefix array indexes, and document these legacy supported forms to avoid accidental behavior changes.

### Release note

None

### Check List (For Author)

- Test:
    - No need to test (comment-only compatibility documentation; runtime behavior is reverted to existing semantics)
- Behavior changed: No
- Does this need documentation: No
@mrhhsg mrhhsg changed the title [fix](be) Reject invalid JSONB path syntax [doc](be) Document JSONB path compatibility May 18, 2026
@mrhhsg
Copy link
Copy Markdown
Member Author

mrhhsg commented May 18, 2026

/review

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Reviewed the current PR diff. I found no blocking issues.

Critical checkpoint conclusions:

  • Goal and tests: The current PR documents existing JSONB path compatibility behavior without runtime changes. The stated no-test rationale is acceptable for a comment-only change.
  • Scope and clarity: The effective diff is small and focused on be/src/util/jsonb_document.h comments.
  • Concurrency and lifecycle: Not applicable; no executable concurrency or lifecycle logic is changed in the effective PR diff.
  • Configuration and compatibility: No new config or protocol/storage compatibility change is introduced. The comments explicitly preserve existing behavior.
  • Parallel paths: The comments cover the root dot-array path, super-wildcard dot-array path, case-insensitive last, and numeric-prefix array indexes in the parser paths where those behaviors exist.
  • Error handling, memory safety, transactions, observability: Not applicable for this comment-only change.
  • Test result changes: No test/result files are part of the effective PR diff.

User focus: No additional user-provided review focus was specified.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants