You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Jesus Camacho Rodriguez (JIRA)" <ji...@apache.org> on 2017/09/12 21:02:00 UTC

[jira] [Created] (CALCITE-1983) Push EQUALS and NOT EQUALS operations with numeric cast on dimensions

Jesus Camacho Rodriguez created CALCITE-1983:
------------------------------------------------

             Summary: Push EQUALS and NOT EQUALS operations with numeric cast on dimensions
                 Key: CALCITE-1983
                 URL: https://issues.apache.org/jira/browse/CALCITE-1983
             Project: Calcite
          Issue Type: Improvement
          Components: druid
    Affects Versions: 1.15.0
            Reporter: slim bouguerra
            Assignee: Jesus Camacho Rodriguez
             Fix For: 1.15.0


For instance, the following query should be pushed as a time-series query with filters.

{code}
use ssb_druid;
Time taken: 0.229 seconds, Fetched: 24 row(s)
hive>
    > explain select
    > sum(discounted_price)
    > from
    > ssb_druid_day
    > where
    > lo_quantity  = 25 ;
OK
Plan optimized by CBO.

Vertex dependency in root stage
Reducer 2 <- Map 1 (SIMPLE_EDGE)

Stage-0
  Fetch Operator
    limit:-1
    Stage-1
      Reducer 2 vectorized, llap
      File Output Operator [FS_14]
        Group By Operator [GBY_13] (rows=1 width=8)
          Output:["_col0"],aggregations:["sum(VALUE._col0)"]
        <-Map 1 [SIMPLE_EDGE] vectorized, llap
          SHUFFLE [RS_12]
            Group By Operator [GBY_11] (rows=1 width=8)
              Output:["_col0"],aggregations:["sum(discounted_price)"]
              Select Operator [SEL_10] (rows=1 width=0)
                Output:["discounted_price"]
                Filter Operator [FIL_9] (rows=1 width=0)
                  predicate:(UDFToDouble(lo_quantity) = 25.0)
                  TableScan [TS_0] (rows=5999989709 width=0)
                    ssb_druid@ssb_druid_day,ssb_druid_day,Tbl:PARTIAL,Col:NONE,Output:["lo_quantity","discounted_price"],properties:{"druid.query.json":"{\"queryType\":\"select\",\"dataSource\":\"ssb_druid_day\",\"descending\":false,\"intervals\":[\"1900-01-01T00:00:00.000/3000-01-01T00:00:00.000\"],\"dimensions\":[\"c_city\",\"c_nation\",\"c_region\",\"d_weeknuminyear\",\"d_year\",\"d_yearmonth\",\"d_yearmonthnum\",\"lo_discount\",\"lo_quantity\",\"p_brand1\",\"p_category\",\"p_mfgr\",\"s_city\",\"s_nation\",\"s_region\"],\"metrics\":[\"lo_revenue\",\"discounted_price\",\"net_revenue\"],\"granularity\":\"all\",\"pagingSpec\":{\"threshold\":16384,\"fromNext\":true},\"context\":{\"druid.query.fetch\":false}}","druid.query.type":"select"}
{code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)