HIVE SQL [Error 10025]: Expression not in GROUP BY key
As long as one ip address has more than 20 rows, all these rows will be returned. If less then 20, do not return.


WITH cte AS ( SELECT *, COUNT(ip_address) OVER (PARTITION BY ip_address) cnt
              FROM my_table
              WHERE DAY = current_date() )
SELECT *
FROM cte
WHERE cnt &gt; 20;