Hello all,

*I was trying to implement a filter rule which can add an extra predicate*,
for example:
*look for GROUP BY clause in a query, check if HAVING is present, if not
add HAVING COUNT(*)>120.*

*I was trying to do the following: *
https://gist.github.com/Soumyadeep-github/47c1131bf02149af995d8e3bccb3ee67

*My approach in this gist *:
get a SqlNode (parsed query) ==> visit each SqlCall node recursively ==>
find SqlSelect (since there's getHaving and setHaving) ==> create a new
dummy query and extract having from the query ==>
set Having for the current query at hand via the dummy query.

*I was wondering if* the same could be achieved in a planner rule. It may
not be a good idea but, for the sake of trying it out, do you think it is
possible? If yes, could you please give me a rough road map.

Thank you for your time and patience!

With regards,
Soumyadeep Mukhopadhyay.

Reply via email to