HunterL commented on pull request #1324:
URL: https://github.com/apache/hive/pull/1324#issuecomment-665824148


   So looking through the Q tests (specifically 
`auto_join_reordering_values.q.out`) we have
   `explain select s.s_store_sk from store_n0 s join store_sales_n0 ss on 
(s.s_store_sk = ss.ss_store_sk) join store_n0 s1 on (s1.s_store_sk = 
ss.ss_store_sk) where s.s_floor_space > 1000`
   
   In the explain plan this produces
   `filterExpr: (((s_floor_space > 1000) and s_store_sk is not null) or 
s_store_sk is not null)`
   This filter expression can be reduced down to `s_store_sk is not null` 
   e.g. ([P && Q] || Q) => Q
   This isn't correct since its going to ignore the `where s.s_floor_space > 
1000`
   
   It seems to me that the correct behavior would be to either...
   1. Continue to combine them naively but with an `and` instead of an `or` and 
allow something downstream to optimize it out.
   e.g. ([P && Q] && Q) which will get reduced down to (P && Q)
   2. Optimize the statement here so that when they are combined you just get 
(P && Q)
   
   There are similar issues in other Q tests but I chose this one for 
simplicity, if this isn't clear I'd be happy to clarify more.


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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org
For additional commands, e-mail: gitbox-h...@hive.apache.org

Reply via email to