Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
Currently Druid Filter Rule doesn't push filters like
OR(AND(F1,F2), F3)
This is due to optimization logic
org.apache.calcite.adapter.druid.DruidRules.DruidFilterRule.splitFilters
Here is an test example:
/** * @TODO Fix this case, Druid can handel this kind of expression but the way * org.apache.calcite.adapter.druid.DruidRules.DruidFilterRule.splitFilters * works doesn't accept this filter */ @Ignore @Test public void testFilterClauseWithMetric2() { String sql = "select sum(\"store_sales\")" + "from \"foodmart\" where \"product_id\" > 1555 or \"store_cost\" > 5 or extract(year " + "from \"timestamp\") = 1997 " + "group by floor(\"timestamp\" to DAY),\"product_id\""; sql(sql) .queryContains(druidChecker("\"queryType\":\"groupBy\"", "{\"type\":\"bound\"," + "\"dimension\":\"store_cost\",\"lower\":\"5\",\"lowerStrict\":true," + "\"ordering\":\"numeric\"}")) .returnsUnordered("to be computed"); }
FYI in this example
extract(year from \"timestamp\") = 1997
will be transformed to
(year >= 1996) AND(year <= 1997)
Attachments
Issue Links
- Is contained by
-
CALCITE-2097 Druid adapter: Push Aggregate and Filter operators containing metric columns to Druid
- Closed