Add query rewrite support for where, group by and nested expressions.

This case is not needed