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

Druid adapter: wrong semantics of groupBy query limit with granularity

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 1.11.0
    • 1.12.0
    • druid-adapter
    • None

    Description

      Similar to CALCITE-1578, but for GroupBy queries. Limit is applied per granularity unit, not globally for the query.

      Currently, the following SQL query infers granularity 'day' for Druid groupBy and pushes the limit, which is incorrect.

      SELECT i_brand_id, floor_day(`__time`), max(ss_quantity), sum(ss_wholesale_cost) as s
      FROM store_sales_sold_time_subset
      GROUP BY i_brand_id, floor_day(`__time`)
      ORDER BY s
      LIMIT 10;
      

      Attachments

        Issue Links

          Activity

            People

              julianhyde Julian Hyde
              jcamacho Jesús Camacho Rodríguez
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: