[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: [OASIS Issue Tracker] (ODATA-827) introduce $compute query option
[ https://issues.oasis-open.org/browse/ODATA-827?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=61350#comment-61350 ] Mark Stafford commented on ODATA-827: ------------------------------------- If we're going for usability, I'd want us to think a bit more holistically about syntactic sugar in URLs. I suspect the most common use of this QSP would be to introduce new properties that get selected, which makes me ask why we wouldn't just support ~/lineItems?$select=*,(quantity*price) as total. So question #1 in my mind is, would there be a way to support an "as"/"=" operator that is syntactic sugar for true projection? There may still be reasons to support $compute explicitly - e.g., that might be the best way to have a reusable calculated value - but that's all the more reason to look at what we're trying to achieve holistically. Here's some interesting URLs to consider supporting: * ~/lineItems?$select=*,(price*quantity) as total * ~/lineItems?$select=*,total=(price*quantity) * ~/orders?$expand=lineItems(select=*,(price*quantity) as total) * ~/lineItems?$select=*,total&$orderby=total=(price*quantity) desc > introduce $compute query option > ------------------------------- > > Key: ODATA-827 > URL: https://issues.oasis-open.org/browse/ODATA-827 > Project: OASIS Open Data Protocol (OData) TC > Issue Type: Improvement > Components: OData Protocol, OData URL Conventions > Affects Versions: V4.0_WD01 > Environment: New Query Capabilities > Reporter: Andrew Eisenberg > Labels: GoodIdea, Usability > Fix For: V4.01_WD01 > > > OData could be extended to allow derived computed values to be returned along with the properties of an entity. > This could be expressed as: > http://odata.netflix.com/v2/Catalog/Titles?$compute=substring(ShortSynopsis,20) as Summary&$select=Name,Summary > In ODATA-9 we added support for an equivalent compute transformation in our Data Aggregation Extensions. -- This message was sent by Atlassian JIRA (v6.2.2#6258)
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]