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

Example 55: clarify groupby in combination with relationships of instance cardinality zero

    XMLWordPrintable

    Details

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

      Proposed

    • Proposal:
      Hide

      Explicitly state what "left-outer-join fashion" means, i.e. not inventing dummy records with null values, instead use empty arrays that match the $expand structure:

       

      { "@odata.id": null, "Country": "France", "Sales": [ ] }
      

       

      Fix the unbalanced curly braces in all result rows while we are at it.

      Show
      Explicitly state what "left-outer-join fashion" means, i.e. not inventing dummy records with null values, instead use empty arrays that match the $expand structure:   { "@odata.id" : null , "Country" : "France" , "Sales" : [ ] }   Fix the unbalanced curly braces in all result rows while we are at it.

      Description

      Example 55:

      GET ~/Customers?$apply=groupby((Country,Sales/Product/Name))

      The example result does not contain an entry for country France. The example data contains a customer in France that does not have any sales.

      The prose text before the example states expansion "in a left-outer-join fashion".

      This would suggest that a result row is missing:

      { "@odata.id": null, "Country": "France", "Sales": [ { "Product":

      { "Name": null }

      } ] }

      This would be consistent with both the left-outer-join statement and the URL conventions for path expressions where properties of related entities are treated as null if no entity is related:

      • the left-outer join would produce a single Sales row containing only null values, including the related product and its name
      • this would create a ("France",null) group during aggregation
      • folding back into the original shape would create the additional entry

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              handl Ralf Handl
            • Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: