Uploaded image for project: 'Kylin'
  1. Kylin
  2. KYLIN-1377

TopN measure should support more expressions

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • v1.4.0
    • Backlog
    • None
    • None

    Description

      TopN should support not only SUM, but also MAX, MIN as the expression.

      A possible case is, find out the sellers which sold the top expensive items:

      select seller_id, max(price) from sals_records where region = 'US' and year = '2015' order by max(price) desc limit 100;

      In the future, more parameter should be supported

      1) the expression (default SUM); 2) the soring order (default Desc). 3) the encoding method:

      A sample is:

      {
          "name" : "TOP_SELLER",
          "function" : {
            "expression" : "TOP_N",
            "parameter" : {
              "id": 0,
              "type" : "column",
              "value" : "PRICE",
              "next_parameter" : {
                "id": 1,
                "type" : "column",
                "value" : "SELLER_ID",
                "next_parameter" : {
                   "id": 2,
                  "type" : "",
                  "value" : "SUM",
                  "next_parameter" : {
                    "id": 3,
                    "type" : "",
                    "value" : "DESC"
                      "next_parameter" : {
                       "id": 4,
                      "type" : "",
                      "value" : "dict"
                  }
                  }
              }
            },
            "returntype" : "topn(100)"
          },
      
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            shaofengshi Shao Feng Shi
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: