We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Datafusion currently knows hot to do the simplifications A OR (A AND B) -> A and A AND (B OR A) -> A but only does them when B is not nullable.
A OR (A AND B) -> A
A AND (B OR A) -> A
B
We should perform the simplifications regardless of the nullabillity of B. Because the simplification still holds even if B is null see:
> CREATE TABLE t (v BOOLEAN) as values (true), (false), (NULL); > select t.v, t2.v, t.v AND (t.v OR t2.v), t.v OR (t.v AND t2.v) from t cross join t as t2; +-------+-------+---------------------+---------------------+ | v | v | t.v AND t.v OR t2.v | t.v OR t.v AND t2.v | +-------+-------+---------------------+---------------------+ | true | true | true | true | | true | false | true | true | | true | | true | true | | false | true | false | false | | false | false | false | false | | false | | false | false | | | true | | | | | false | | | | | | | | +-------+-------+---------------------+---------------------+
No response
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Is your feature request related to a problem or challenge?
Datafusion currently knows hot to do the simplifications
A OR (A AND B) -> A
andA AND (B OR A) -> A
but only does them whenB
is not nullable.Describe the solution you'd like
We should perform the simplifications regardless of the nullabillity of
B
. Because the simplification still holds even ifB
is null see:Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: