drill
drill copied to clipboard
DRILL-8512: ReduceAndSimplifyFilterRule fails with NullPointerException
DRILL-8512: ReduceAndSimplifyFilterRule fails with NullPointerException
Description
I'm not sure why the following issue wasn't before, but it's clear, why the issue appears at all - because we provide neither inputs RelNodes(we calling DrillOptiq.toDrill with null for the input, see code change) or RexBuilder along with RelDataType.
Testing
Tested with the query the issue was reproduced:
SELECT *
FROM
(
SELECT
(CASE WHEN (true) THEN 'qwe' ELSE null END) res1
FROM (VALUES(1)) test_tbl
) test
where res1 IN ('ab','dab','qw','qwe')
@jnturton I'm unsure whether the fix is correct because calcite is a black box to me, but I think I found the correct place where the change should be made.
I'll be glad if you advise me on how to cover the case with unit tests.
@jnturton I'm unsure whether the fix is correct because calcite is a black box to me, but I think I found the correct place where the change should be made.
I'll be glad if you advise me on how to cover the case with unit tests.
You're not the only one to whom Calcite is a black box... :-)
I saw the failing tests. I need to find another solution to solve the issue...