Uploaded image for project: 'OASIS Open Data Protocol (OData) TC'
  1. OASIS Open Data Protocol (OData) TC
  2. ODATA-1349

Calculate Custom Aggregates from Aggregated Instances

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: V4.0_CS02
    • Fix Version/s: V4.0_CSD04
    • Component/s: Data Aggregation
    • Labels:
      None
    • Environment:

      Applied

    • Proposal:
      Hide

      Interpretation of this statement is too strict; it is actually intended to allow custom aggregates on intermediate results.

      State more precisely that custom aggregates are also available for aggregated instances created from the defining structure:

      “When applied to a structured type, the annotation specifies custom aggregates that are available for collections of instances of that structured type or of aggregated instances resulting from these instances.”

      Show
      Interpretation of this statement is too strict; it is actually intended to allow custom aggregates on intermediate results. State more precisely that custom aggregates are also available for aggregated instances created from the defining structure: “When applied to a structured type, the annotation specifies custom aggregates that are available for collections of instances of that structured type or of aggregated instances resulting from these instances .”

      Description

      A CustomAggregate annotation defines a dynamic property that can be used in the aggregate transformation. The current document states in 6.2.3 Custom Aggregates, second paragraph: “When applied to a structured type, the annotation specifies custom aggregates that are available for collections of instances of that structured type.”

      This also means that a custom aggregate cannot be applied to an intermediate, already aggregated result produced by $apply transformations. Such a result consists of aggregated instances that are based on the structure of the instances from which they have been calculated (4        Representation of Aggregated Instances) and some properties from the originating type have been aggregated away.

      This limits the applicability of custom aggregates and prevents requests for use cases like this example: For a custom aggregate “Amount”, determine the total amount for countries with a sales amount greater than X:

      GET ~/Sales?$apply=groupby((Country),aggregate(Amount))/filter(Amount gt X)/aggregate(Amount)

      This can be a valid request under the assumption that Amount can be calculated for a set of aggregated instances each having a value for the Amount property.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              gerald.krause1 Gerald Krause
            • Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: