Added rule to handle unresolved attributes in HAVING clauses (SPARK-2226)
Whitelist HAVING queries.

Also adds golden outputs for HAVING tests.
Added explanatory comments.