mrhhsg opened a new pull request, #63301:
URL: https://github.com/apache/doris/pull/63301
### What problem does this PR solve?
Issue Number: DORIS-25573
Related PR: None
Problem Summary: `json_contains('[1,1,1]', '[1,1]')` should return true, but
the previous JSONB array containment logic counted matching target elements and
compared that count with the candidate array length. Duplicate candidate
elements therefore produced incorrect false results. This change checks each
candidate array element independently against the target array, matching
non-consuming containment semantics.
### Release note
Fix `json_contains` returning false when the candidate array contains
duplicate elements already present in the target array.
### Check List (For Author)
- Test: Unit Test
- `./run-be-ut.sh --run --filter=JsonbContainsTest.* -j 32`
- `build-support/check-format.sh`
- `git diff --check 66dbb85fe3deaf9069bc58f78446fe998ba5810b..HEAD`
- `build-support/run-clang-tidy.sh --build-dir be/ut_build_ASAN` (failed
because clang-tidy could not analyze existing headers in this environment:
`be/src/core/types.h` has an unmatched `NOLINTEND`, and the toolchain could not
resolve `stddef.h`/intrinsic headers)
- Behavior changed: Yes
- `json_contains` now follows non-consuming array containment semantics
for duplicate candidate elements.
- Does this need documentation: No
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]