morrySnow opened a new pull request, #64696:
URL: https://github.com/apache/doris/pull/64696
### What problem does this PR solve?
Issue Number: None
Related PR: None
Problem Summary: `IS TRUE`, `IS FALSE`, `IS NOT TRUE`, and `IS NOT FALSE` in
Nereids did not preserve SQL three-valued logic correctly because the parser
reused generic boolean expressions instead of representing these predicates
explicitly. This patch adds Nereids `IsTrue` and `IsFalse` expressions, parses
`IS TRUE` and `IS FALSE` into those nodes, and rewrites them during expression
analysis to boolean casts guarded by `IS NOT NULL`. With the existing `NOT`
wrapper from parsing, `IS NOT TRUE` and `IS NOT FALSE` now correctly include
NULL rows.
### Release note
Fix Nereids null semantics for `IS TRUE`, `IS FALSE`, `IS NOT TRUE`, and `IS
NOT FALSE` predicates.
### Check List (For Author)
- Test:
- Unit Test: `./run-fe-ut.sh --run
org.apache.doris.nereids.parser.NereidsParserTest`
- Unit Test: `./run-fe-ut.sh --run
org.apache.doris.nereids.rules.analysis.ExpressionAnalyzerTest`
- Regression test: `./run-regression-test.sh --run -d
query_p0/sql_functions -s test_is_true_false_predicate -forceGenOut`
- Behavior changed: Yes. Nereids now returns SQL three-valued logic
compliant results for `IS TRUE`, `IS FALSE`, `IS NOT TRUE`, and `IS NOT FALSE`.
- 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]