发布

  • fix: preserve unknown semantics for json path predicates (#50702)

    frostbyte_neo 发布于 2026-06-26 11:52:27 +00:00

    issue: #50699

    Fixes #50699

    What this PR does

    This PR makes JSON path predicate missing/null/type-mismatch behavior
    preserve UNKNOWN consistently:

    • Treats parent JSON NULL, missing nested paths, incompatible path
      types, and invalid array paths as UNKNOWN instead of operator-specific
      boolean constants.
    • Preserves JSON stats/index validity bitmaps when returning cached
      bitmap results.
    • Updates parser rewrite behavior and tests that previously assumed
      scalar JSON missing-path != was a definite true result.
    • Aligns raw, stats/index, brute-force, offset/iterative, and NOT
      behavior around SQL-style three-valued logic.

    Verification

    • cmake -S internal/core -B cmake_build
    • ninja -v unittest/all_tests
    • go test -buildvcs=false -count=1 ./internal/parser/planparserv2/rewriter
    • Focused C++ JSON nullable/contains suite passed 705/705.
    • Additional binary-range/non-nullable JSON range/term suite passed
      540/540.
    • git diff --check passed.
    • Staged diff check passed.

    Signed-off-by: Buqian Zheng zhengbuqian@gmail.com

    下载附件