throw proper errors if predicates are used outside WHERE clause