sajjad-moradi commented on pull request #7394:
URL: https://github.com/apache/pinot/pull/7394#issuecomment-912830324


   I think we should directly update 
`CalciteSqlParser.updateComparisonPredicate`. This has the following benefits:
   1. CalciteSqlParser already rewrites queries to convert `WHERE a = b` to 
`WHERE a - b = 0`. Now we're adding one more optimizer to convert `WHERE a - b 
= 0` to `WHERE compare(a,b) = 0`. Instead we can directly convert `WHERE a = b` 
to `WHERE compare(a,b) = 0`.
   2. Basically this is not an optimization, it's fixing a bug in the query 
rewrite logic.
   3. `StringPredicateFilterOptimizer` code is very similar - not exact 
duplicate - to `CalciteSqlParser.updateComparisonPredicate`. With small change 
in the existing updateComparisonPredicate method, we can fix the bug.
   4. We don't need to split the rewrite logic in two places. If something 
changes or a bug surfaces in the rewrite logic, we should only update one place 
in the code.


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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to