xinlifoobar commented on PR #11266: URL: https://github.com/apache/datafusion/pull/11266#issuecomment-2220510013
> Thanks @xinlifoobar -- this makes sense to me > > Another potential way to fix this issue would be to cast / coerce NULL literals in the WHERE clause to boolean > > Basically we could add the equivalent of `NULL::boolean` > > For example, given the input > > ```sql > SELECT ... FROM foo WHERE NULL and x = 5; > ``` > > We could transform it to > > ```sql > SELECT ... FROM foo WHERE NULL::boolean and x = 5; > ``` > > That might result in simpler code as FilterExec would not have to be aware of `DataType::null` > > Perhaps it would fit in https://github.com/apache/datafusion/blob/main/datafusion/optimizer/src/analyzer/type_coercion.rs > > However, I think this PR is better than main and we could try to see if the alternate approach loked better as a future work (or never) This is a lot... Let me looking into this. -- 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: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org