This applyPostFilter() method is for subqueries in joins. We can have some conditions in ON clause or WHERE clause to be pushed down into individual join tables, and if the join table is a subquery, we call this method to merge this post-filter into the subquery, as a WHERE condition or a HAVING condition so that in some cases these post-filters can be optimized as pre-filters. 
Those cases that would throw exceptions from here are very rare, basically like:
1) select ... from A join (select id, b from T limit 10) as B on A.id = B.id where B.b = 'b'
2) select ... from A join (select count(*) c from T) as B on A.a = B.c where B.c > 10

However, this post-filter can be easily handled in joins. I will make another check-in later.