[fix](be) Reject super wildcard path in json keys#63300
Open
mrhhsg wants to merge 1 commit into
Open
Conversation
### What problem does this PR solve?
Issue Number: None
Related PR: None
Problem Summary: Fixes Jira DORIS-25570. json_keys/jsonb_keys rejected ordinary wildcard paths but allowed super wildcard paths such as $**.a to fall through and return NULL. The function only supports reading keys from a single object, so super wildcard paths should fail with the same INVALID_JSON_PATH error as other wildcard paths.
### Release note
Reject unsupported super wildcard JSON paths in json_keys/jsonb_keys instead of returning NULL.
### Check List (For Author)
- Test: Unit Test / Regression test / Static check
- Unit Test: ./run-be-ut.sh --run --filter=FunctionJsonbTEST.JsonbKeysRejectSuperWildcardPath
- Regression test: Added regression-test/suites/jsonb_p0/test_jsonb_keys_invalid_path.groovy (not run locally; no FE/BE cluster was listening on configured regression ports)
- Static check: build-support/check-format.sh
- Static check: build-support/run-clang-tidy.sh --build-dir be/ut_build_ASAN (failed due to pre-existing function_jsonb.cpp complexity diagnostics and toolchain header/NOLINTEND errors)
- Behavior changed: Yes (json_keys/jsonb_keys now return INVALID_JSON_PATH for $** paths instead of NULL)
- Does this need documentation: No
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Member
Author
|
/review |
Contributor
There was a problem hiding this comment.
Automated review summary for PR 63300 at 7aabb3f.
No blocking issues found.
Critical checkpoint conclusions:
- Goal and proof: The PR aims to reject unsupported
**JSON path tokens injson_keys/jsonb_keys. The implementation addsis_supper_wildcard()checks in both const-path and non-const-path branches, and adds BE unit/regression coverage for both paths. - Scope: The code change is small and focused on the existing wildcard rejection logic.
- Concurrency: No new concurrency, shared state, locks, or lifecycle-sensitive objects are introduced.
- Lifecycle/static initialization: No new static/global initialization dependency is introduced.
- Configuration: No configuration item is added.
- Compatibility/behavior: This is an intentional user-visible behavior change from returning NULL to returning
INVALID_JSON_PATHfor unsupported super-wildcard paths. - Parallel paths:
jsonb_keysis an alias ofjson_keys, so the BE change covers both names through the shared implementation. Existing wildcard rejection in the related JSON modification path already checksis_supper_wildcard(). - Conditional checks: The added condition directly extends the existing unsupported wildcard validation to the parser's super-wildcard flag.
- Tests: A BE unit test covers const and non-const path execution, and a regression test covers SQL const and query-derived path expressions. I attempted
./run-be-ut.sh --run --filter=FunctionJsonbTEST.JsonbKeysRejectSuperWildcardPath, but it timed out during first-timecontrib/apache-orcsubmodule cloning before executing the test. - Observability: No additional observability appears necessary for this validation-only change.
- Transaction/persistence/data writes: Not applicable.
- FE/BE variable passing: Not applicable.
- Performance: The added checks are constant-time after path parsing and do not add meaningful overhead.
- User focus points: No additional user-provided review focus was present.
Residual risk: The regression test was not executed in this review environment, and the targeted BE unit test could not be completed because dependency initialization exceeded the command timeout.
Member
Author
|
run buildall |
Contributor
TPC-H: Total hot run time: 31190 ms |
Contributor
TPC-DS: Total hot run time: 169150 ms |
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: None
Related PR: None
Problem Summary:
json_keys/jsonb_keysrejected ordinary wildcard paths but allowed super wildcard paths such as $**.a to fall through and return NULL. The function only supports reading keys from a single object, so super wildcard paths should fail with the same INVALID_JSON_PATH error as other wildcard paths.Release note
Reject unsupported super wildcard JSON paths in json_keys/jsonb_keys instead of returning NULL.
Check List (For Author)