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

Druid Expressions - Output Type of Boolean expressions should be set to LONG.

    Details

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

      Description

      Sample Query -

       
      SELECT \"product_id\" > 1000 as pid_category, COUNT(\"store_sales\") FROM FOODMART_TABLE GROUP BY \"product_id\" > 1000";
      

      For the above query output type of virtual column is set to string whereas it should be set to float as druid expression return type is float.

      "{"queryType":"groupBy","dataSource":"foodmart","granularity":"all","dimensions":[{"type":"default","dimension":"vc","outputName":"vc","outputType":"STRING"}],"virtualColumns":[{"type":"expression","name":"vc","expression":"(CAST(\"product_id\", 'LONG') > 1000)","outputType":"FLOAT"}],"limitSpec":{"type":"default"},"aggregations":[{"type":"filtered","filter":{"type":"not","field":{"type":"selector","dimension":"store_sales","value":null}},"aggregator":{"type":"count","name":"EXPR$1","fieldName":"store_sales"}}],"intervals":["1900-01-09T00:00:00.000Z/2992-01-10T00:00:00.000Z"]}"
      

        Attachments

          Activity

            People

            • Assignee:
              nishantbangarwa Nishant Bangarwa
              Reporter:
              nishantbangarwa Nishant Bangarwa
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: