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

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

    XMLWordPrintable

    Details

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

      Applied

    • Proposal:
      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

      Description

      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.

        Attachments

          Activity

            People

            • Assignee:
              handl Ralf Handl
              Reporter:
              martinzurmuehl Martin Zurmuehl
            • Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: