Open biber-baek opened 3 months ago
Hey @biber-baek,
Could you share the commands you used to create this distributed table so that I can try reproducing this on my end?
Any commands you used to create & distribute the table and to create the underlying column types would help a lot.
Thanks!
@onurctirtir thanks for your reply. It is reproduced by the command below.
CREATE TABLE report_day (
report_date timestamp without time zone NOT NULL,
campaign_id bigint NOT NULL,
ad_id bigint NOT NULL,
account_id bigint NOT NULL,
sketch_col public.theta_sketch
);
select create_distributed_table('report_day','ad_id');
insert into report_day select now() - (g%10 || 'day')::interval, g, trunc(random() * 100 + 1), g%10, (select public.theta_sketch_build(1)) from generate_series(1, 100) g;
select report_date, public.theta_sketch_union(sketch_col) as reach
from report_day where account_id='7'
group by report_date;
Could you please also share the definition of theta_sketch type?
I am using the datasketches extension to calculate approximate values in analytical work. The theta_sketch type is a type provided by datasketches.
[local] citus@citus:9700-18493=# explain analyze select report_date, campaign_id, theta_sketch_get_estimate(theta_sketch_union(reach))
from
(select report_date,campaign_id, theta_sketch_union(reach_ds) as reach
from report_day where service_account_id='599267'
group by report_date, campaign_id,representative_id
) a
group by report_date, campaign_id
order by campaign_id, report_date
limit 10;
ERROR: column "reach_ds" does not exist
LINE 3: ...elect report_date,campaign_id, theta_sketch_union(reach_ds) ...
^
Time: 0.233 ms
[local] citus@citus:9700-18493=# explain select report_date, campaign_id, theta_sketch_get_estimate(theta_sketch_union(reach))
from
(select report_date,campaign_id, theta_sketch_union(reach_ds) as reach
from report_day where service_account_id='599267'
group by report_date, campaign_id,representative_id
) a
group by report_date, campaign_id
order by campaign_id, report_date
limit 10;
ERROR: column "reach_ds" does not exist
LINE 3: ...elect report_date,campaign_id, theta_sketch_union(reach_ds) ...
^
Time: 0.217 ms
@biber-baek When I attempted to reproduce the issue, I encountered the same error mentioned above. Could there be a missing step in the reproduction process?
Hi.
When using the datasketches parallel aggregate function on distributed tables in Citus, an error occurs as seen in 'explain analyze'. However, if I run a query without an analyze or use only 'explain', it works fine.