Hi,
I am executing the following SQL, which is working fine.
select Category, CountryName, Store_Name,
APPROX_COUNT_DISTINCT(prod_hyper) as apx_hyper_prod, APPROX_COUNT_DISTINCT_DS_HLL( Product_id,21,‘HLL_8’ ) as apx_theta_prod
from retail_data_rollup_index_hyper where
TIME_EXTRACT("__time",‘day’)>0
group by Category, CountryName,Store_Name
but, if i add having clause to the above SQL, it is running out of memory.
select Category, CountryName, Store_Name,
APPROX_COUNT_DISTINCT(prod_hyper) as apx_hyper_prod, APPROX_COUNT_DISTINCT_DS_HLL( Product_id,21,‘HLL_8’ ) as apx_theta_prod
from retail_data_rollup_index_hyper where
TIME_EXTRACT("__time",‘day’)>0
group by Category, CountryName,Store_Name having apx_hyper_prod != apx_theta_prod
I think the approx count computation is getting evaluated 2 times - in Select and having clause and thus causing out of memory. I dont know how to validate and confirm. Just thought of sharing with the group.
Regards, Chari.