Details

    • Type: Bug
    • 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

      Update request in example 57:

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

      Rewrite section on aggregate, last item in list on "virtual property $count": replace it with "$count, which is a shortcut for 1 with sum"

      Show
      Update request in example 57: GET ~/Products?$apply=groupby((Name),aggregate(Sales/$count with sum as SalesCount)) Rewrite section on aggregate, last item in list on "virtual property $count": replace it with "$count, which is a shortcut for 1 with sum"
    • Resolution:
      Show
      https://github.com/oasis-tcs/odata-abnf/pull/12

      Description

      Section 3.1 introduces $count as one of several options for aggregate expressions.

      Example 57 applies $count relative to a collection-valued navigation property, which is a different use case that is backed by the commonExpr ABNF rule to address the count of a collection (see URL spec, section 4.8). Since section 3.1 requires commonExpr to be augmented with an aggregation method, such a method must be added to the request in the example.

      The current aggregation ABNF contains a rule for $count with a path prefix, which needs to be cleaned up accordingly.

        Attachments

          Activity

          Hide
          mikep Michael Pizzo (Inactive) added a comment -

          Resolved as proposed 2018-11-15.

          Show
          mikep Michael Pizzo (Inactive) added a comment - Resolved as proposed 2018-11-15.
          Hide
          mikep Michael Pizzo (Inactive) added a comment - - edited

          re-opened while reviewing the proposed application 2018-12-6.

          Concern that use of unprefixed $count within a navigation expression inside an aggregation as implicitly referencing the navigation set, as per the following example, is unexpected and inconsistent.

          $apply=groupby((Name),aggregate(Sales($count as SalesCount),Sales(Amount with sum as Total)))

          The semantics of the expression within the parens following the navigation is that it operates on each instance within the navigation set, so $count having a special meaning here would be inconsistent. 

          At the top level, this can be a shortcut for "1 with sum", as in:

          Sales?$apply=groupby((Product/Name),aggregate($count as SalesCount,Amount with sum as Total))

          with the key difference that, for an empty input set, 1 with sum would be null, while $count would be zero.

          Show
          mikep Michael Pizzo (Inactive) added a comment - - edited re-opened while reviewing the proposed application 2018-12-6. Concern that use of unprefixed $count within a navigation expression inside an aggregation as implicitly referencing the navigation set, as per the following example, is unexpected and inconsistent. $apply=groupby((Name),aggregate(Sales($count as SalesCount),Sales(Amount with sum as Total))) The semantics of the expression within the parens following the navigation is that it operates on each instance within the navigation set, so $count having a special meaning here would be inconsistent.  At the top level, this can be a shortcut for "1 with sum", as in: Sales?$apply=groupby((Product/Name),aggregate($count as SalesCount,Amount with sum as Total)) with the key difference that, for an empty input set, 1 with sum would be null, while $count would be zero.
          Hide
          handl Ralf Handl added a comment -

          2018-12-06

          Show
          handl Ralf Handl added a comment - 2018-12-06
          Hide
          mikep Michael Pizzo (Inactive) added a comment -

          Further discussion 2020-5-28:
          The previous syntax was, in fact, valid, since $count is an aggregate expression, just as Amount with Sum is an aggregate expression.

          Show
          mikep Michael Pizzo (Inactive) added a comment - Further discussion 2020-5-28: The previous syntax was, in fact, valid, since $count is an aggregate expression, just as Amount with Sum is an aggregate expression.
          Hide
          mikep Michael Pizzo (Inactive) added a comment -

          Resolved as proposed 2020-5-28.

          Show
          mikep Michael Pizzo (Inactive) added a comment - Resolved as proposed 2020-5-28.

            People

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

              Dates

              • Created:
                Updated:
                Resolved: