[chore](be) Document lightweight JSONB validation#63359
Draft
mrhhsg wants to merge 1 commit into
Draft
Conversation
14699fa to
e28deaf
Compare
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
### What problem does this PR solve?
Issue Number: DORIS-25577
Related PR: None
Problem Summary: Avoid making JsonbDocument::checkAndCreateDocument perform recursive full validation by default. The helper is used in JSONB query hot paths, while INSERT and load paths build JSONB through JsonBinaryValue/JsonbWriter before storage.
### Release note
None
### Check List (For Author)
- Test:
- Manual test: git diff --check
- Behavior changed: No
- Does this need documentation: No
e28deaf to
2b51e87
Compare
Member
Author
|
/review |
Contributor
There was a problem hiding this comment.
Review completed. I found no blocking issues in the actual PR diff, which only documents that JsonbDocument::checkAndCreateDocument and createValue intentionally perform lightweight structural validation.
Critical checkpoint conclusions:
- Goal and tests: The PR documents the intended validation boundary/hot-path tradeoff and does not change behavior.
git diff --checkpasses for the touched files. - Scope: The change is small and focused on comments in the two JSONB helper locations.
- Concurrency/lifecycle/config/incompatibility: Not applicable; no runtime behavior, shared state, config, storage format, or protocol changes.
- Parallel paths: Both
checkAndCreateDocumentandcreateValuenow carry matching guidance. - Error handling/data correctness/memory/performance: No code-path behavior changes; the comments preserve the existing lightweight hot-path validation contract.
- Test coverage/results: No new functional tests are required for comment-only changes; no generated results were modified.
- Observability/transaction/persistence/FE-BE passing: Not applicable.
User focus: No additional user-provided review focus was present.
Member
Author
|
run buildall |
Contributor
TPC-H: Total hot run time: 31902 ms |
Contributor
TPC-DS: Total hot run time: 170404 ms |
Contributor
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
Contributor
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem does this PR solve?
Issue Number: DORIS-25577
Problem Summary: After evaluating the JSONB INSERT/Stream Load path and JSONB query call sites, recursive full validation in
JsonbDocument::checkAndCreateDocumentis not appropriate for the default helper. INSERT and load inputs are JSON text that BE re-encodes throughJsonBinaryValue/JsonbWriter, whilecheckAndCreateDocumentandcreateValueare also used by JSONB scalar/table functions in per-row hot paths.This PR documents why these helpers intentionally remain lightweight and why any future deep validation should be added only at a clearly untrusted raw JSONB binary boundary.
Release note
None
Check List (For Author)
git diff --check