Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.34.0
Description
The minimal reproducer is to construct a RexCall with RexUnknownAs.FALSE as below:
SEARCH(1, Sarg[IS NOT NULL])
After RexSimplify#simplifySearch, the final simplified result is IS NOT NULL(1), which should be TRUE more thoroughly.
Also, the following RexCall with RexUnknownAs.TRUE:
SEARCH(1, Sarg[IS NULL])
Is simplified to IS NULL(1), which should be FALSE.
Another two cases:
The following RexCall with RexUnknownAs.UNKNOWN:
SEARCH(1, Sarg[=])
Is simplified to 1 IS NOT NULL OR NULL, which should be TRUE.
The following RexCall with RexUnknownAs.UNKNOWN:
SEARCH(1, Sarg[<>])
Is simplified to 1 <> 1, which should be FALSE.
Note that current simplified result is inconsistent with RexCall.isAlwaysFalse and isAlwaysTrue.
Therefore, for the above two reasons, I think we need to simplify SEARCH operator with special sarg more thoroughly.
Attachments
Issue Links
- duplicates
-
CALCITE-4679 Search/sarg simplification leaves is not null(literal) unsimplified
- Closed
- links to