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

Examples 60, 61: Missing aggregation method for $count on related entities

    XMLWordPrintable

    Details

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

      Proposed

    • Proposal:
      Hide

      Ex 60: Replace

      GET ~/Products?$apply=groupby((Name),aggregate(Sales/$count as SalesCount))

      with

      GET ~/Products?$apply=groupby((Name),aggregate(Sales/$count with sum as SalesCount))

      Ex 61: Replace

      GET ~/Products?$apply=groupby((Name),aggregate(Sales/$count as SalesCount,Sales(Amount with sum as TotalAmount)))

      with

      GET ~/Products?$apply=groupby((Name),aggregate(Sales/$count with sum as SalesCount,Sales(Amount with sum as TotalAmount)))

      Show
      Ex 60: Replace GET ~/Products?$apply=groupby((Name),aggregate(Sales/$count as SalesCount)) with GET ~/Products?$apply=groupby((Name),aggregate(Sales/$count with sum as SalesCount)) Ex 61: Replace GET ~/Products?$apply=groupby((Name),aggregate(Sales/$count as SalesCount, Sales(Amount with sum as TotalAmount))) with GET ~/Products?$apply=groupby((Name),aggregate(Sales/$count with sum as SalesCount, Sales(Amount with sum as TotalAmount)))

      Description

      The examples make use of $count applied to a path expression in an aggregate expression without specifying an aggregation method, e.g. aggregate(Sales/$count as SalesCount)

      This syntax construct and its semantics has been introduced in the Core specification, section 11.2.6.1 System Query Option $filter and must not be confused with the virtual property $count defined in the Data Aggregation extension specification, section 3.1.5 Virtual Property $count. It represents a common expression that, if used in the aggregate transformation, must be complemented with an aggregation method.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated: