[SPARK-2225] Turn HAVING without GROUP BY into WHERE.

@willb