OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

odata message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: [OASIS Issue Tracker] (ODATA-1459) Clarify representation of property paths with leading segments being null


Gerald Krause created ODATA-1459:
------------------------------------

             Summary: Clarify representation of property paths with leading segments being null
                 Key: ODATA-1459
                 URL: https://issues.oasis-open.org/browse/ODATA-1459
             Project: OASIS Open Data Protocol (OData) TC
          Issue Type: Improvement
          Components: Data Aggregation
    Affects Versions: V4.0_CS02
            Reporter: Gerald Krause
             Fix For: V4.0_CSD04


The specification text contains an example for tranformation {{outerjoin}} whose result is applied to a subsequent {{groupby}} transformation:

Example 66:
{code:java}
GET ~/Customers?$apply=outerjoin(Sales as ProductSales)
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ /groupby((Country,ProductSales/Product/Name))
{code}
returning
{code:java}
{
 "@odata.context":"$metadata#Customers(Country,ProductSales(Product(Name)))",
 "value": [
 ÂÂÂ { "Country": "Netherlands",
ÂÂÂÂÂ "ProductSales": { "Product": { "Name": "Paper"Â } },
 ÂÂÂ { "Country": "Netherlands",
ÂÂÂÂÂ "ProductSales": { "Product": { "Name": "Sugar"Â } },
 ÂÂÂ { "Country": "USA",
ÂÂÂÂÂ "ProductSales": { "Product": { "Name": "Coffee" } },
 ÂÂÂ { "Country": "USA",
ÂÂÂÂÂ "ProductSales": { "Product": { "Name": "Paper"Â } },
 ÂÂÂ { "Country": "USA",
ÂÂÂ ÂÂ"ProductSales": { "Product": { "Name": "Sugar"Â } },
ÂÂÂ { "Country": "France", "ProductSales": null }
 ]
}
{code}
---

Looking at the first step, {{outerjoin}} returns combinations of customer instances and the related sales instances:
{code:java}
[
 { 'ID': 'C1', 'Name': 'Joe', 'Country': 'USA', 'ProductSales': { 'ID': '1', â } },
 { 'ID': 'C1', 'Name': 'Joe', 'Country': 'USA', 'ProductSales': { 'ID': '2', â } },
  â
 { 'ID': 'C4', 'Name': Luc', 'Country': France', 'ProductSales': null }
]
{code}
The following {{groupby}} operates on two grouping properties: {{Country}} and {{ProductSales/Product/Name}}.

The latter property path is not defined for the last instance returned by {{outerjoin}}. Intuition says its value should be null.

It should be clarified
 # that the value for such a property path is clearly defined in some specification, when a leading segment is already null
 # how the {{groupby}} result should look like for the last instance returned by {{outerjoin}}:
 ## like shown above:
 {{'ProductSales': null}}
 ## returning the complete structure of the grouping property:
 {{'ProductSales': \{ 'Product': { 'Name': null } }Â}}

Â

Â

Â



--
This message was sent by Atlassian Jira
(v8.3.3#803004)


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]