Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-1983

Push EQUALS and NOT EQUALS operations with numeric cast on dimensions to Druid

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.15.0
    • Fix Version/s: 1.15.0
    • Component/s: druid
    • Labels:
      None

      Description

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

      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"}
      

        Activity

        Hide
        julianhyde Julian Hyde added a comment -

        Resolved in release 1.15.0 (2017-12-11).

        Show
        julianhyde Julian Hyde added a comment - Resolved in release 1.15.0 (2017-12-11).
        Hide
        jcamachorodriguez Jesus Camacho Rodriguez added a comment -

        Fix-up in http://git-wip-us.apache.org/repos/asf/calcite/commit/6971a30 (wrong value for strict boolean). Added additional tests.

        Show
        jcamachorodriguez Jesus Camacho Rodriguez added a comment - Fix-up in http://git-wip-us.apache.org/repos/asf/calcite/commit/6971a30 (wrong value for strict boolean). Added additional tests.
        Show
        jcamachorodriguez Jesus Camacho Rodriguez added a comment - Fixed in http://git-wip-us.apache.org/repos/asf/calcite/commit/e0eeb1b .
        Hide
        julianhyde Julian Hyde added a comment -

        When you log a JIRA case, please remember that its title will be read by people who do not work on Druid all day.

        Show
        julianhyde Julian Hyde added a comment - When you log a JIRA case, please remember that its title will be read by people who do not work on Druid all day.
        Hide
        jcamachorodriguez Jesus Camacho Rodriguez added a comment -

        slim bouguerra, I have created a PR for this:
        https://github.com/apache/calcite/pull/536

        Could you take a look? Thanks

        Show
        jcamachorodriguez Jesus Camacho Rodriguez added a comment - slim bouguerra , I have created a PR for this: https://github.com/apache/calcite/pull/536 Could you take a look? Thanks

          People

          • Assignee:
            jcamachorodriguez Jesus Camacho Rodriguez
            Reporter:
            bslim slim bouguerra
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development