[ 
https://issues.apache.org/jira/browse/CALCITE-2098?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jesus Camacho Rodriguez resolved CALCITE-2098.
----------------------------------------------
    Resolution: Fixed

> Push filters to Druid Query Scan when we have OR of AND clauses
> ---------------------------------------------------------------
>
>                 Key: CALCITE-2098
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2098
>             Project: Calcite
>          Issue Type: Bug
>          Components: druid
>            Reporter: slim bouguerra
>            Assignee: slim bouguerra
>            Priority: Major
>             Fix For: 1.16.0
>
>
> Currently Druid Filter Rule doesn't push filters like {code} OR(AND(F1,F2), 
> F3){code} 
> This is due to optimization logic 
> {code}org.apache.calcite.adapter.druid.DruidRules.DruidFilterRule.splitFilters{code}
> Here is an test example:
> {code}
> /**
>    * @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");
>   }
> {code}
> FYI in this example {code} extract(year from \"timestamp\") = 1997{code} will 
> be transformed to {code}(year >= 1996) AND(year <= 1997){code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to