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

groupby algorithm does not cover "select distinct" case

    XMLWordPrintable

    Details

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

      Add a sentence to step 2 of the four-step algorithm:

      Applies set transformations to each subset according to the second parameter, resulting in a new set of potentially different structure and cardinality. If the second parameter is absent, transforms each subset into a set consisting of a single instance without properties,

      Rephrase the later remark about "select distinct":

      If the second parameter can be is omitted, steps 2 and 3 produce one instance containing only the grouping properties per to request distinct value combination of the grouping properties.

      Show
      Add a sentence to step 2 of the four-step algorithm: Applies set transformations to each subset according to the second parameter, resulting in a new set of potentially different structure and cardinality. If the second parameter is absent, transforms each subset into a set consisting of a single instance without properties, Rephrase the later remark about "select distinct": If the second parameter can be is omitted, steps 2 and 3 produce one instance containing only the grouping properties per to request distinct value combination of the grouping properties.
    • Resolution:
      Show
      https://www.oasis-open.org/apps/org/workgroup/odata/download.php/69078/odata-data-aggregation-ext-v4.0-wd05.docx

      Description

      The four-step algorithm given at the beginning of the groupby transformation does not describe what happens for Products?$apply=groupby((Category)). According to a later remark, this is supposed to select only the distinct Categories. But, after step 1, I have two subsets

      ID Category Name Color TaxRate
      P1 PG1 Sugar White 0.06
      P2 PG1 Coffee Brown 0.06

      and

      ID Category Name Color TaxRate
      P3 PG2 Paper White 0.14
      P4 PG2 Pencil Black 0.14

      Step 2 cannot be carried out due to lack of a second parameter. Step 3 has no effect. Step 4 concatenates these two subsets again, so that the overall effect is of groupby((Category),identity).

      To keep the case without second parameter within the four-step framework, step 2 must essentially produce an instance without properties, leading to subsets

      ID Category Name Color TaxRate
               

      and

      ID Category Name Color TaxRate
               

      which step 3 would then change to

      ID Category Name Color TaxRate
        PG1      

      and

      ID Category Name Color TaxRate
        PG2      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              heiko.theissen Heiko Theissen
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: