guojidan commented on issue #9140:
URL: 
https://github.com/apache/arrow-datafusion/issues/9140#issuecomment-1968371247

   hi @manoj-inukolunu , `ShortenInListSimplifier` should be executed after 
`InListSimplifier` has executed. one Expr will be executed recursively at each 
`Simplifier`
   example: 
   > c1 IN (1,2,3,4,5,6) AND c1 IN (1,3,5,6) AND c1 IN (3,6)  
   
   `InListSimplifier`
   1. c1 IN (1,2,3,4,5,6) -> c1 IN (1,2,3,4,5,6)
   2. c1 IN (1,3,5,6)  -> c1 IN (1,3,5,6)
   3. c1 IN (3,6) -> c1 IN (3,6)
   4. c1 IN (1,2,3,4,5,6) AND c1 IN (1,3,5,6) -> c1 IN (1,3,5,6)
   5. c1 IN (1,3,5,6) AND c1 IN (3,6)
   6. c1 IN (3,6)
   
   `ShortenInListSimplifier`
   8. c1 = 3 OR c1 = 6
   
   if we combile the `ShortenInListSimplifier` with the `InListSimplifier`, it 
will become below workflow:
   1. c1 IN (1,2,3,4,5,6) -> c1 IN (1,2,3,4,5,6)
   2. c1 IN (1,3,5,6)  -> c1 IN (1,3,5,6)
   3. c1 IN (3,6) -> c1 = 3 OR c1 = 6
   4. c1 IN (1,2,3,4,5,6) AND c1 IN (1,3,5,6) -> c1 IN (1,3,5,6)
   5. c1 IN (1,3,5,6) AND c1 = 3 OR c1 = 6
   
   maybe you can view older version inlist simplifier logical(before my pr), I 
can got more inspiration
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to