Details

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

      Applied

    • Proposal:
      Hide
      1. Updates to sections 3.1 and 3.1.1 in the specification: https://www.oasis-open.org/apps/org/workgroup/odata/download.php/67246/ODATA-945%20-%20Proposal%20for%20Spec%20Update.docx
      2. Update examples in document:

      Replace response payload of example 53 with

      {
      "@odata.context": "$metadata#Products(Name,Total)",
      "value": [

      { "@odata.id": null, "Name": "Coffee", "Total": 12 }

      ,

      { "@odata.id": null, "Name": "Paper", "Total": 8 }

      ,

      { "@odata.id": null, "Name": "Pencil", "Total": null }

      ,

      { "@odata.id": null, "Name": "Sugar", "Total": 4 }

      ]
      }

      Example 54: Modify request to properly reflect the nesting shown in the response:
      GET ~/Products?$apply=groupby((Name,Sales/Currency/Code),
      aggregate(Sales(Amount with sum as Total)))

      Correct Example 61 as

      { "Name": "Coffee", "Forecast": 6, "Sales": [ { "Actual": 12 } ] }
      
      Show
      Updates to sections 3.1 and 3.1.1 in the specification: https://www.oasis-open.org/apps/org/workgroup/odata/download.php/67246/ODATA-945%20-%20Proposal%20for%20Spec%20Update.docx Update examples in document: Replace response payload of example 53 with { "@odata.context": "$metadata#Products(Name,Total)", "value": [ { "@odata.id": null, "Name": "Coffee", "Total": 12 } , { "@odata.id": null, "Name": "Paper", "Total": 8 } , { "@odata.id": null, "Name": "Pencil", "Total": null } , { "@odata.id": null, "Name": "Sugar", "Total": 4 } ] } Example 54: Modify request to properly reflect the nesting shown in the response: GET ~/Products?$apply=groupby((Name,Sales/Currency/Code), aggregate(Sales(Amount with sum as Total))) Correct Example 61 as { "Name" : "Coffee" , "Forecast" : 6, "Sales" : [ { "Actual" : 12 } ] }

      Description

      Example 53 requests aggregation of property path Sales/Amount, but the response shows the dynamic property Total nested inside Sales. Rightly, it should have been “added to the type containing the original expression” (section 3.1.1).
      In example 54, the response payload shows the dynamic property Total nested within Sales. According to the request, which uses the path expression Sales/Amount for aggregation, the Total property should be at the top level.

        Attachments

          Activity

          Hide
          handl Ralf Handl added a comment -

          Hubert: we have to explain more about the differences

          Ralf: plain paths with / work like compute: pull arguments from related entities, place result "at the top" Parentheses can be used to place the result within the related/nested structure

          Ralf: Slight difference:

          GET ~/Products?$apply=groupby((Name,Sales/Currency/Code),aggregate(Sales(Amount with sum as Total))) 
          GET ~/Products?$apply=groupby((Name,Sales/Currency/Code),aggregate(Sales/Amount with sum as Total))
          

          Ralf: 3.1.1 Keyword as

          Aggregate expressions can define an alias using the as keyword, followed by a SimpleIdentifier (see [OData-CSDL, section 17.2]). The alias will introduce a dynamic property in the aggregated result set. The introduced dynamic property is added to the type containing the original expression or custom aggregate. The alias MUST NOT collide with names of declared properties, custom aggregates, or other aliases in that type.

          Ralf: Sales/Amount with sum as Total Sales(Amount with sum as Total)

          George: be more explicit in the definition and not define by example

          Ralf: First example: in top context we are interested in the Amount Second example: we are interested in the Sales, and within the Sales in the Amount Need to revise the specification text: section 3.1.1

          Show
          handl Ralf Handl added a comment - Hubert: we have to explain more about the differences Ralf: plain paths with / work like compute: pull arguments from related entities, place result "at the top" Parentheses can be used to place the result within the related/nested structure Ralf: Slight difference: GET ~/Products?$apply=groupby((Name,Sales/Currency/Code),aggregate(Sales(Amount with sum as Total))) GET ~/Products?$apply=groupby((Name,Sales/Currency/Code),aggregate(Sales/Amount with sum as Total)) Ralf: 3.1.1 Keyword as Aggregate expressions can define an alias using the as keyword, followed by a SimpleIdentifier (see [OData-CSDL, section 17.2] ). The alias will introduce a dynamic property in the aggregated result set. The introduced dynamic property is added to the type containing the original expression or custom aggregate. The alias MUST NOT collide with names of declared properties, custom aggregates, or other aliases in that type. Ralf: Sales/Amount with sum as Total Sales(Amount with sum as Total) George: be more explicit in the definition and not define by example Ralf: First example: in top context we are interested in the Amount Second example: we are interested in the Sales, and within the Sales in the Amount Need to revise the specification text: section 3.1.1
          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
          Hide
          gerald.krause1 Gerald Krause added a comment -

          Uploaded the reviewed version of the document update and linked it in the proposal.

          Show
          gerald.krause1 Gerald Krause added a comment - Uploaded the reviewed version of the document update and linked it in the proposal.
          Hide
          heiko.theissen Heiko Theissen added a comment - - edited

          Example 61 must also be corrected.

          { "Name": "Coffee", "Forecast": 6, "Sales": [ { "Actual": 12 } ] }
          
          Show
          heiko.theissen Heiko Theissen added a comment - - edited Example 61 must also be corrected. { "Name" : "Coffee" , "Forecast" : 6, "Sales" : [ { "Actual" : 12 } ] }
          Hide
          gerald.krause1 Gerald Krause added a comment -

          Resolved 2021-01-07

          Show
          gerald.krause1 Gerald Krause added a comment - Resolved 2021-01-07

            People

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

              Dates

              • Created:
                Updated:
                Resolved: