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

$all not available for rolling up named hierarchies

    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:

      Applied

    • Proposal:
      Hide

      1.

      Introduce a further grouping operator rollupall that combines rollup/$all and replaces $all:

      2.

      Update handling for leveled hierarchies. In 3.10.2  Grouping with rollup and $all:

      • Replace the mentions of $all with rollupall
      • Replace processing rule for groupby((rollup($all, )), ) with: groupby((rollupall(p1)),, ) is equivalent to concat(groupby(( ), ), )

      3.  // not needed. For details see this comment: https://issues.oasis-open.org/browse/ODATA-1377?focusedCommentId=79188&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-79188

      Update handling for recursive hierarchies. ODATA-1218 specifies groupby(rollup(...),...) for recursive hierarchies. In the proposed extension, add these processing rules for the given input set:

      • The result of groupby((rollupall(RHQ),R),T) is defined as
        {{ concat (groupby((R),T),groupby((rollup(RHQ), R), T))}}
      • The result of groupby((rollupall(RHQ)),T) is defined as
        {{ concat (T,groupby((rollup(RHQ)), T))}}

      4.

      Services announce support for rollup via annotation of term ApplySupported with property Rollup of type RollupType.

      Proposal is to keep this and treat rollup/rollupall as a single capability and to express this in the documentation of the RollupType enumeration:

      SingleHierarchy - Only one rollup or rollupall operator per groupby
      MultipleHierarchies - Full support for rollup and rollupall

      Show
      1. Introduce a further grouping operator rollupall that combines rollup / $all and replaces $all : Rollup an unnamed leveled hierarchy incl. root level GET Sales?$apply=groupby(rollupall(Product/Name,Product/Category/Name), T) Rollup an named leveled hierarchy incl. root level GET Sales?$apply=groupby(rollupall(Product/ProductHierarchy), T) Rollup a named recursive hierarchy incl. root nodes // not needed. For details see this comment: - https://issues.oasis-open.org/browse/ODATA-1377?focusedCommentId=79188&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-79188- GET SalesOrganizations?$apply=groupby(rollupall(SalesOrgHierarchy), T) 2. Update handling for leveled hierarchies. In  3.10.2  Grouping with rollup and $all : Replace the mentions of $all with rollupall Replace processing rule for groupby((rollup($all, )), ) with: groupby((rollupall(p1)),, ) is equivalent to concat(groupby(( ), ), ) 3.   // not needed. For details see this comment: https://issues.oasis-open.org/browse/ODATA-1377?focusedCommentId=79188&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-79188 Update handling for recursive hierarchies.  ODATA-1218 specifies groupby(rollup(...),...) for recursive hierarchies. In the proposed extension , add these processing rules for the given input set: The result of groupby((rollupall(RHQ),R),T) is defined as {{ concat (groupby((R),T),groupby((rollup(RHQ), R), T))}} The result of groupby((rollupall(RHQ)),T) is defined as {{ concat (T,groupby((rollup(RHQ)), T))}} 4. Services announce support for rollup via annotation of term ApplySupported with property Rollup of type RollupType . Proposal is to keep this and treat rollup / rollupall as a single capability and to express this in the documentation of the RollupType enumeration: SingleHierarchy - Only one rollup or rollupall operator per groupby MultipleHierarchies - Full support for rollup and rollupall
    • Resolution:
      Show
      https://github.com/oasis-tcs/odata-vocabularies/pull/123

      Description

      $all is defined in 3.10.2 Grouping with rollup and $all. For unnamed leveled hierarchies it may be used to introduce a virtual root level that allows to aggregate over all specified hierarchy levels. In other words, this feature offers a “grand total” for unnamed leveled hierarchies.

      The feature is equally interesting for named hierarchies, where the hierarchy is specified by the qualifier of a LeveledHierarchy annotation. However, in this case, $all cannot be expressed and thus no “grand total” can be requested from a named hierarchy.

      The same limitation applies to groupby((rollup(HierQual)),...), if HierQual refers to a qualifier of an annotation with term RecursiveHierarchy, which is discussed in ODATA-1218.

       

      Simply allowing $all also for named hierarchies does not work as the following example shows:

      Rollup with named leveled hierarchy:
      GET Sales?$apply=groupby(rollup(Product/ProductHierarchy), T)
      is equivalent to unnamed leveled hierarchy
      GET Sales?$apply=groupby(rollup(Product/Name,Product/Category/Name), T)

      Additionally rolling up the root levels:

      • For unnamed leveled hierarchy
        GET Sales?$apply=groupby(rollup($all,Product/Name,Product/Category/Name), T)
      • For named hierarchy this does not work, because the qualifier may clash with property name, e.g.
        GET Sales?$apply=groupby(rollup($all,Product/ProductHierarchy), T)

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: