Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
Description
After Calcite is upgraded to 1.14 and the rule to push post-aggregations to Druid is enabled, the following query fails to create a postaggregation:
EXPLAIN SELECT language, sum(added) + 100 AS a FROM druid_table_1 GROUP BY language ORDER BY a DESC;
Problem seems to be that CAST is getting on the way for the rule to be applied. In particular, this is the final Calcite plan:
HiveSortLimit(sort0=[$1], dir0=[DESC-nulls-last])
HiveProject(language=[$0], a=[+($1, CAST(100):DOUBLE)])
DruidQuery(table=[[default.druid_table_1]], intervals=[[1900-01-01T00:00:00.000/3000-01-01T00:00:00.000]], groups=[{6}], aggs=[[sum($10)]])
There are two different parts to explore to seek a solution: 1) why CAST(100):DOUBLE) is not folded to 100.0d, and 2) whether the rule to push post-aggregations to Druid could handle the CAST in some particular cases.
Attachments
Issue Links
- is broken by
-
HIVE-17717 Enable rule to push post-aggregations into Druid
- Closed
- Is contained by
-
CALCITE-2170 Use Druid Expressions capabilities to improve the amount of work that can be pushed to Druid
- Closed