Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRILL-8512: ReduceAndSimplifyFilterRule fails with NullPointerException #2944

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rymarm
Copy link
Member

@rymarm rymarm commented Sep 24, 2024

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') 

@rymarm
Copy link
Member Author

rymarm commented Sep 24, 2024

@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.

@cgivre
Copy link
Contributor

cgivre commented Sep 25, 2024

@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... :-)

@rymarm
Copy link
Member Author

rymarm commented Sep 26, 2024

I saw the failing tests. I need to find another solution to solve the issue...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants