Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
Description
create temporary table tmp_tbl( `rule_id` string, `severity` string, `alert_id` string, `alert_type` string); explain cbo select `k`.`rule_id`, count(distinct `k`.`alert_id`) over(partition by `k`.`rule_id`) `subj_cnt` from tmp_tbl k ; explain select `k`.`rule_id`, count(distinct `k`.`alert_id`) over(partition by `k`.`rule_id`) `subj_cnt` from tmp_tbl k ;
Fails CBO, because the count(distinct) is not being recognized as belonging to a windowing operation.
So it throws the following exception
throw new CalciteSemanticException("Distinct without an aggregation.", UnsupportedFeature.Distinct_without_an_aggreggation);
This prevents a query like this from using a materialized view which already exists in the system (the MV obviously does not contain this expression, but represents a complex transform from a JSON structure into a columnar layout).
Attachments
Issue Links
- links to