PQI: Specification of Aggregate element in query is unclear

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major
    • None
    • Hide

      I propose we go with structure (A) as the additional ColName elements are not necessary - group by can just be an array of column names

      Show
      I propose we go with structure (A) as the additional ColName elements are not necessary - group by can just be an array of column names

      I'm looking at using schema to document the Query and its responses. This is mostly OK, but I've run into a blocker with the Aggregate.

      The spec has the following structure:

      Aggregate (OPTIONAL)

      • Columns (list)
        • ColName: column name, see below
        • Aggregator: aggregator function, one of AVG,
          SUM, COUNT, MIN, MAX, STDDEV
      • GroupBy (list) (OPTIONAL)
        --ColName: column name

      That suggests an object containing two lists:

      {
      "Aggregate":

      { "Columns": [], "GroupBy": [] }

      }

      which could expand to something like this: (A)

      {
      "Aggregate": {
      "Columns": [

      { "ColName": "a", "Aggregator": "SUM" }

      ,

      { "ColName": "b", "Aggregator": "AVG" }

      ],
      "GroupBy": ["a", "b"]
      }
      }

      of if GroupBy has to have a ColName then it would be this: (B)

      {
      "Aggregate": {
      "Columns": [

      { "ColName": "a", "Aggregator": "SUM" }

      ,

      { "ColName": "b", "Aggregator": "AVG" }

      ],
      "GroupBy": [

      { "ColName": "a" }

      ,

      { "ColName": "b" }

      ]
      }
      }

      We have no examples of GroupBy and the only example of Aggregate (C, below) does not have an array, just a single item:

      {
      "Aggregate": {
      "Columns":

      { "ColName": "WHAT_CLUSTER", "Aggregator": "COUNT" }

      }
      }

            Assignee:
            David Snelling (Inactive)
            Reporter:
            paul.bruton
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: