Define the behaviour of system query option $count and path segment /$count in combination with $apply

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major
    • V4.0_CSD03
    • Affects Version/s: V4.0_CSD01
    • Component/s: Data Aggregation
    • None
    • Environment:

      Applied

    • Hide

      Adapt 3.15 "Evaluating $apply" accordingly.

      $apply on resource paths ending in /$count acts on the set "preceding" the /$count, the result is the plain-text number of items in the result of $apply, similar to the combination of /$count and $filter

      $count system query option is executed after $apply, @odata.count contains the number of items in the result of $apply

      Applied: https://www.oasis-open.org/committees/document.php?document_id=56041&wg_abbrev=odata

      Show
      Adapt 3.15 "Evaluating $apply" accordingly. $apply on resource paths ending in /$count acts on the set "preceding" the /$count, the result is the plain-text number of items in the result of $apply, similar to the combination of /$count and $filter $count system query option is executed after $apply, @odata.count contains the number of items in the result of $apply Applied: https://www.oasis-open.org/committees/document.php?document_id=56041&wg_abbrev=odata

      Assume GET ~/Products/$count results in 100.
      Assume GET ~/Products?$apply=groupby((Name), aggregate(Sales/Amount with sum as Total)) results in a set with 4 entries (see example 50)

      What is the response for GET ~/Products/$count?$apply=groupby((Name), aggregate(Sales/Amount with sum as Total))?

      What is the value of @odata.count in the response for GET ~/Products?$apply=groupby((Name), aggregate(Sales/Amount with sum as Total))&$count=true?

      My proposal is: in both cases 4.

            Assignee:
            handl
            Reporter:
            martinzurmuehl
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: