djiangc commented on issue #14326:
URL: https://github.com/apache/druid/issues/14326#issuecomment-1572735826
Hi, @gianm
sorry for the late response. please find the SQL here:
```with t1(merge_column, s1) as
(
SELECT 0 as merge_column,
DS_THETA(person_ids)
FROM agg_adi_acr_person_reach WHERE __time >= '2023-04-15' and
__time < '2023-05-16'
)
SELECT
gp_col1,
sum(ts2),
sum(ts1),
sum(ts3)
FROM (
SELECT gp_col1,
gp_multiplier,
THETA_SKETCH_ESTIMATE((DS_THETA(s2))) as ts2,
THETA_SKETCH_ESTIMATE((DS_THETA(s1))) as ts1,
gp_multiplier *
THETA_SKETCH_ESTIMATE(THETA_SKETCH_INTERSECT(DS_THETA(s2), DS_THETA(s1))) as ts3
FROM (
SELECT 0 AS merge_column,
demo_bucket AS gp_col1,
rounded_ipfp_weight As gp_multiplier,
DS_THETA(person_ids) as s2
FROM agg_adi_person_demo_dma_dimensons_reach
WHERE rounded_ipfp_weight != 0 and __time >=
'2023-04-01' and __time < '2023-05-01'
GROUP BY demo_bucket,
rounded_ipfp_weight
) t2
JOIN t1
ON t1.merge_column = t2.merge_column
GROUP BY gp_col1,
gp_multiplier
)
GROUP BY gp_col1```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]