Uh oh!
There was an error while loading. Please reload this page.
branch-4.1: [fix](be) Compare JSON numeric values by value #63396 - #63488
Merged
Conversation
### What problem does this PR solve? Issue Number: None Related PR: None Problem Summary: json_contains compared JSONB numeric values by their stored binary categories. As a result, semantically equal numbers such as integer 1 and floating-point 1.0, or decimals with different scales, were not treated as contained. This changes JsonbValue::contains to compare integer, floating-point, and decimal JSONB values by numeric value, while keeping exact integer and decimal comparisons to avoid precision-related false matches. ### Release note Fix json_contains to match semantically equal JSON numeric values across numeric storage categories. ### Check List (For Author) - Test: - Build: ./build.sh --be --fe - Unit Test: ./run-be-ut.sh --run --filter=JsonbDocumentTest.contains_numeric_equality - Regression test: ./run-regression-test.sh --conf output/local-regression/regression-conf-29000.groovy --run -d query_p0/sql_functions/json_functions -s test_json_contains_numeric_equality -forceGenOut - Regression test: ./run-regression-test.sh --conf output/local-regression/regression-conf-29000.groovy --run -d query_p0/sql_functions/json_functions -s test_json_contains_numeric_equality - Style: build-support/check-format.sh - Style: git diff --check - Static analysis: build-support/run-clang-tidy.sh --build-dir be/build_Release (attempted; failed on pre-existing header/system include diagnostics unrelated to the changed lines) - Behavior changed: Yes (json_contains now treats semantically equal JSON numeric values across integer, floating-point, and decimal JSONB representations as contained) - Does this need documentation: No
hello-stephen
commented
May 21, 2026
Contributor
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
hello-stephen
commented
May 21, 2026
Contributor
run buildall |
yiguolei
commented
May 22, 2026
Contributor
run buildall |
yiguolei
approved these changes
May 22, 2026
Uh oh!
There was an error while loading. Please reload this page.
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 freeto 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.
Cherry-picked from #63396