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

Facilitate processing of aggregated results created with concat

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: V4.0_CSD03
    • Fix Version/s: V4.0_CSD04
    • Labels:
      None
    • Environment:

      Proposed

    • Proposal:
      Hide

      No action as this can be solved by the client e.g. using compute():

      GET ~/Sales?$apply=concat(
      filter(<complex expression 1>)/groupby((Customer),aggregate(Amount with sum as Total))/compute(1 as concat_index),
      filter(<complex expression 2>)/groupby((Customer),aggregate(Amount with sum as Total))/compute(2 as concat_index))

      Show
      No action as this can be solved by the client e.g. using compute(): GET ~/Sales?$apply=concat( filter(<complex expression 1>)/groupby((Customer),aggregate(Amount with sum as Total))/compute(1 as concat_index), filter(<complex expression 2>)/groupby((Customer),aggregate(Amount with sum as Total))/compute(2 as concat_index))

      Description

      The concat transformation creates a potentially heterogeneous result set consisting of entities with different structures.

      The result is a contiguous list of entities without explicit boundaries to separate the result entities created by one concat parameter from the next. In case an OData client needs to know the concat parameter to which a result entity is related, it has to evaluate the result entities with the same or similar logic expressed in the request a second time.

      Example:
      Using the example model from the Data Aggregation extension, consider a request to retrieve sales amounts grouped by customer for two different subsets of sales entities qualified by complex filter expressions:

      GET ~/Sales?$apply=concat(
      filter(<complex expression 1>)/groupby((Customer),aggregate(Amount with sum as Total)),
      filter(<complex expression 2>)/groupby((Customer),aggregate(Amount with sum as Total)))

      Which is the last entity in the result collection that matches complex expression 1?

        Attachments

          Activity

          gerald.krause1 Gerald Krause created issue -
          handl Ralf Handl made changes -
          Field Original Value New Value
          Component/s Vocabularies [ 10324 ]
          gerald.krause1 Gerald Krause made changes -
          Proposal Repeating the logic on client side can be avoided, if the server adds information about the related concat parameter to every entity in the result of a transformation sequence passed to concat.

          For this purpose, this new term could be annotated to these entities:
          <Term Name=“RelatedConcatParameter“ Type=“Edm.Int16“>
            <Annotation Term="Core.Description" String="Position of the transformation sequence in the list of concat parameters, whose result contans this entity. Position counting starts at 0" />
          </Term>

          A server should (must) add this annotation, if concat is the last transformation in the sequence passed to $apply, i.e. concat is not nested inside another transformation or followed by another transformation.
          Several options seem to exist:

          Option A
          Repeating the logic on client side can be avoided, if the server adds information about the related concat parameter to every entity in the result of a transformation sequence passed to concat.

          For this purpose, this new term could be annotated to these entities:
          <Term Name=“RelatedConcatParameter“ Type=“Edm.Int16“>
            <Annotation Term="Core.Description" String="Position of the transformation sequence in the list of concat parameters, whose result contans this entity. Position counting starts at 0" />
          </Term>

          A server should (must) add this annotation, if concat is the last transformation in the sequence passed to $apply, i.e. concat is not nested inside another transformation or followed by another transformation.

          Option B
          The number of annotations required in the response payload could be reduced by annotating only the entities at the boundary of the next partial result, using this term:
          <Term Name=“ResultOfContextArgument“ Type=“Edm.Int16“>
            <Annotation Term="Core.Description" String="Index number of the argument provided to the concat transformation whose result contains this and subsequent entities. The first argument has index 0." />
          </Term>

          Description The concat transformation creates a potentially heterogeneous result set consisting of entities with different structures.

          The result is a contiguous list of entities without explicit boundaries to separate the result entities created by one concat parameter from the next. In case an OData client needs to know the concat parameter to which a result entity is related, it has to evaluate the result entities with the same or similar logic expressed in the request a second time.

          Example:
          Using the example from the Data Aggregation extension, consider a request to retrieve sales amounts grouped by customer for two different subsets of sales entities qualified by complex filter expressions:

          GET ~/Sales?$apply=concat(
          filter(<complex expression 1>)/groupby((Customer),aggregate(Amount with sum as Total)),
            filter(<complex expression 2>)/groupby((Customer),aggregate(Amount with sum as Total)))

          Which is the last entity in the result collection that matches complex expression 1?
          The concat transformation creates a potentially heterogeneous result set consisting of entities with different structures.

          The result is a contiguous list of entities without explicit boundaries to separate the result entities created by one concat parameter from the next. In case an OData client needs to know the concat parameter to which a result entity is related, it has to evaluate the result entities with the same or similar logic expressed in the request a second time.

          Example:
          Using the example model from the Data Aggregation extension, consider a request to retrieve sales amounts grouped by customer for two different subsets of sales entities qualified by complex filter expressions:

          GET ~/Sales?$apply=concat(
          filter(<complex expression 1>)/groupby((Customer),aggregate(Amount with sum as Total)),
            filter(<complex expression 2>)/groupby((Customer),aggregate(Amount with sum as Total)))

          Which is the last entity in the result collection that matches complex expression 1?
          gerald.krause1 Gerald Krause made changes -
          Proposal Several options seem to exist:

          Option A
          Repeating the logic on client side can be avoided, if the server adds information about the related concat parameter to every entity in the result of a transformation sequence passed to concat.

          For this purpose, this new term could be annotated to these entities:
          <Term Name=“RelatedConcatParameter“ Type=“Edm.Int16“>
            <Annotation Term="Core.Description" String="Position of the transformation sequence in the list of concat parameters, whose result contans this entity. Position counting starts at 0" />
          </Term>

          A server should (must) add this annotation, if concat is the last transformation in the sequence passed to $apply, i.e. concat is not nested inside another transformation or followed by another transformation.

          Option B
          The number of annotations required in the response payload could be reduced by annotating only the entities at the boundary of the next partial result, using this term:
          <Term Name=“ResultOfContextArgument“ Type=“Edm.Int16“>
            <Annotation Term="Core.Description" String="Index number of the argument provided to the concat transformation whose result contains this and subsequent entities. The first argument has index 0." />
          </Term>

          Several options seem to exist:

          Option A
          Repeating the logic on client side can be avoided, if the server adds information about the related concat parameter to every entity in the result of a transformation sequence passed to concat.

          For this purpose, this new term could be annotated to these entities:
          <Term Name=“RelatedConcatParameter“ Type=“Edm.Int16“>
            <Annotation Term="Core.Description" String="Position of the transformation sequence in the list of concat parameters, whose result contans this entity. Position counting starts at 0" />
          </Term>

          A server should (must) add this annotation, if concat is the last transformation in the sequence passed to $apply, i.e. concat is not nested inside another transformation or followed by another transformation.

          Option B
          The number of annotations required in the response payload could be reduced by annotating only the entities at the boundary of the next partial result, using this term:
          <Term Name=“ResultOfConcatArgument“ Type=“Edm.Int16“>
            <Annotation Term="Core.Description" String="Index number of the argument provided to the concat transformation whose result contains this and subsequent entities. The first argument has index 0." />
          </Term>

          mikep Michael Pizzo (Inactive) made changes -
          Status New [ 10000 ] Open [ 1 ]
          handl Ralf Handl made changes -
          Resolution Won't Fix [ 2 ]
          Status Open [ 1 ] Resolved [ 5 ]
          handl Ralf Handl made changes -
          Proposal Several options seem to exist:

          Option A
          Repeating the logic on client side can be avoided, if the server adds information about the related concat parameter to every entity in the result of a transformation sequence passed to concat.

          For this purpose, this new term could be annotated to these entities:
          <Term Name=“RelatedConcatParameter“ Type=“Edm.Int16“>
            <Annotation Term="Core.Description" String="Position of the transformation sequence in the list of concat parameters, whose result contans this entity. Position counting starts at 0" />
          </Term>

          A server should (must) add this annotation, if concat is the last transformation in the sequence passed to $apply, i.e. concat is not nested inside another transformation or followed by another transformation.

          Option B
          The number of annotations required in the response payload could be reduced by annotating only the entities at the boundary of the next partial result, using this term:
          <Term Name=“ResultOfConcatArgument“ Type=“Edm.Int16“>
            <Annotation Term="Core.Description" String="Index number of the argument provided to the concat transformation whose result contains this and subsequent entities. The first argument has index 0." />
          </Term>

          No action as this can be solved by the client e.g. using compute():

          GET ~/Sales?$apply=concat(
          filter(<complex expression 1>)/groupby((Customer),aggregate(Amount with sum as Total))/compute(1 as concat_index),
            filter(<complex expression 2>)/groupby((Customer),aggregate(Amount with sum as Total))/compute(2 as concat_index))
          Status Resolved [ 5 ] Applied [ 10002 ]
          handl Ralf Handl made changes -
          Status Applied [ 10002 ] Closed [ 6 ]

            People

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

              Dates

              • Created:
                Updated:
                Resolved: