thomasrebele commented on code in PR #4616:
URL: https://github.com/apache/calcite/pull/4616#discussion_r2511370771
##########
core/src/test/resources/sql/sub-query.iq:
##########
@@ -1472,7 +1472,7 @@ EnumerableCalc(expr#0..3=[{inputs}],
expr#4=[null:BOOLEAN], expr#5=[IS NOT NULL(
# Test project null IN nullable
select sal,
cast(null as int) IN (
- select case when true then deptno else null end
+ select case when deptno>0 then deptno else null end
Review Comment:
Due to the latest changes, RexSimplify is now able to simplify `(CAST
nonNullableTinyInt TO nullableInteger) IS NOT NULL` to true, as the cast is
lossless. If necessary I can add a RexProgramTest test case:
`checkSimplify(isNotNull(cast(vIntNotNull(), nullable(tDecimal()))), "true");`
in the next round.
I think the `case when true then deptno else null end` may be simplified to
`deptno`, so further changes to the simplification might break the intent of
the test. To future-proof this test I've changed the condition to prevent the
simplification from removing it.
I've seen there are other files using similar CASE WHEN TRUE constructs.
Does it make sense to adapt those as well in a follow-up ticket?
--
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]