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

*Subject*: **[OASIS Issue Tracker] Updated: (ODATA-294) Clarifications needed for Filter System Query Option: Operators and Functions**

*From*:**OASIS Issues Tracker <workgroup_mailer@lists.oasis-open.org>***To*: odata@lists.oasis-open.org*Date*: Wed, 13 Mar 2013 21:34:49 -0400 (EDT)

[ http://tools.oasis-open.org/issues/browse/ODATA-294?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Evan Ireland updated ODATA-294: ------------------------------- Description: Some questions which may be nicely addressed by additional clarifications in the URL Conventions spec... Logical Operators: Q1. Apart from EQ and NE (where comparison with null can be easily understood to always return TRUE or FALSE), what is the result of using GT, GE, LT, LE with one (or both arguments) being NULL? Possible answers: (a) undefined by the spec; (b) result is NULL; (c) result is FALSE; (d) a NULL value is considered less-than non-NULL values. If the answer is (b) NULL, then we should define that a filter that evaluates to NULL is considered FALSE, for the purposes of determining a filter match. Since NULLs may propagate up the filter expresion tree rather quickly. Arithmetic Operators: Q2. What is the result of an arithmetic operator applied to one (or both) NULL operands? Possible answers: (a) undefined by the spec; (b) NULL. Q3. What is the ordering of numeric types for promotion when mixed types are used (e.g. if ADD is applied to Single and Decimal, what type is the result)? Suggested answer: SByte, Int16, Int32, Int64, Decimal, Single, Double. Decimal is considered "less" than Single because Single can in nearly all implementations have a larger exponent than Decimal (so we prefer "range" over "precision" for promotion). Q4. What is the result of a canonical function applied to one (or more) NULL parameters? Possible answers: (a) undefined by the spec; (b) NULL; (c) depends on the function (e.g. boolean-valued functions might return FALSE). OrderBy: Q5. Where does NULL occur in ascending sort, and where in descending sort? Spaces in URLs Q6. Examples in the spec show spaces in filters. Shouldn't these be %-encoded (e.g. "%20") so they are valid in URLs? Filter Related Q7. Which primitive types support the use of LT, LE, GT, GE? (when answering, consider in particular the binary, boolean and geo types)? Q8. Which geo types permit the use of EQ and NE? When comparing points (e.g. latitude/longitude for GeographyPoint) is the comparison of coordinates assumed to use Decimal or Double comparison (consider that Single/Double are not usually recommended as suitable for use in database indexes due to the possibility of rounding errors affecting comparisons). Q9. Are the LHS and RHS operands for a logical operator allowed to have different types (e.g. LHS=Decimal, RHS=Int32)? If so, then can non-string values be compared with string values? Q10. What is the result of division/modulo arithmetic operators where the divisor is zero? Is it undefined by the spec, null, or +/- infinity? (noting that infinity is only applicable to Single/Double). Q11. What are the rules for the calculation of the result of modulo where one or both operands are negative? Q12. What are the rules for scale of the results of arithmetic operators where the operands are decimal? Q13. Which style of rounding is used by the round function (e.g. round-half-even)? Q14. Does the 'length' function calculate length according to UTF-8 bytes, UTF-16 characters, or something else? (noting that the CSDL spec defines String as a fixed-length or variable-length sequence of UTF-8 characters, we should just ensure that we have consistent rules for filters). Q15. Has it been considered to define a 'count' function that would return the number of elements in a structural or navigation property? was: Some questions which may be nicely addressed by additional clarifications in the URL Conventions spec... Logical Operators: Q1. Apart from EQ and NE (where comparison with null can be easily understood to always return TRUE or FALSE), what is the result of using GT, GE, LT, LE with one (or both arguments) being NULL? Possible answers: (a) undefined by the spec; (b) result is NULL; (c) result is FALSE; (d) a NULL value is considered less-than non-NULL values. If the answer is (b) NULL, then we should define that a filter that evaluates to NULL is considered FALSE, for the purposes of determining a filter match. Since NULLs may propagate up the filter expresion tree rather quickly. Arithmetic Operators: Q2. What is the result of an arithmetic operator applied to one (or both) NULL operands? Possible answers: (a) undefined by the spec; (b) NULL. Q3. What is the ordering of numeric types for promotion when mixed types are used (e.g. if ADD is applied to Single and Decimal, what type is the result)? Suggested answer: SByte, Int16, Int32, Int64, Decimal, Single, Double. Decimal is considered "less" than Single because Single can in nearly all implementations have a larger exponent than Decimal (so we prefer "range" over "precision" for promotion). Q4. What is the result of a canonical function applied to one (or more) NULL parameters? Possible answers: (a) undefined by the spec; (b) NULL; (c) depends on the function (e.g. boolean-valued functions might return FALSE). OrderBy: Q5. Where does NULL occur in ascending sort, and where in descending sort? Spaces in URLs Q6. Examples in the spec show spaces in filters. Shouldn't these be %-encoded (e.g. "%20") so they are valid in URLs? > Clarifications needed for Filter System Query Option: Operators and Functions > ----------------------------------------------------------------------------- > > Key: ODATA-294 > URL: http://tools.oasis-open.org/issues/browse/ODATA-294 > Project: OASIS Open Data Protocol (OData) TC > Issue Type: Improvement > Components: OData URL Conventions > Affects Versions: V4.0_WD01 > Reporter: Evan Ireland > > Some questions which may be nicely addressed by additional clarifications in the URL Conventions spec... > Logical Operators: > Q1. Apart from EQ and NE (where comparison with null can be easily understood to always return TRUE or FALSE), what is the result of using GT, GE, LT, LE with one (or both arguments) being NULL? > Possible answers: (a) undefined by the spec; (b) result is NULL; (c) result is FALSE; (d) a NULL value is considered less-than non-NULL values. > If the answer is (b) NULL, then we should define that a filter that evaluates to NULL is considered FALSE, for the purposes of determining a filter match. Since NULLs may propagate up the filter expresion tree rather quickly. > Arithmetic Operators: > Q2. What is the result of an arithmetic operator applied to one (or both) NULL operands? > Possible answers: (a) undefined by the spec; (b) NULL. > Q3. What is the ordering of numeric types for promotion when mixed types are used (e.g. if ADD is applied to Single and Decimal, what type is the result)? > Suggested answer: SByte, Int16, Int32, Int64, Decimal, Single, Double. Decimal is considered "less" than Single because Single can in nearly all implementations have a larger exponent than Decimal (so we prefer "range" over "precision" for promotion). > Q4. What is the result of a canonical function applied to one (or more) NULL parameters? > Possible answers: (a) undefined by the spec; (b) NULL; (c) depends on the function (e.g. boolean-valued functions might return FALSE). > OrderBy: > Q5. Where does NULL occur in ascending sort, and where in descending sort? > Spaces in URLs > Q6. Examples in the spec show spaces in filters. Shouldn't these be %-encoded (e.g. "%20") so they are valid in URLs? > Filter Related > Q7. Which primitive types support the use of LT, LE, GT, GE? (when answering, consider in particular the binary, boolean and geo types)? > Q8. Which geo types permit the use of EQ and NE? When comparing points (e.g. latitude/longitude for GeographyPoint) is the comparison of coordinates assumed to use Decimal or Double comparison (consider that Single/Double are not usually recommended as suitable for use in database indexes due to the possibility of rounding errors affecting comparisons). > Q9. Are the LHS and RHS operands for a logical operator allowed to have different types (e.g. LHS=Decimal, RHS=Int32)? If so, then can non-string values be compared with string values? > Q10. What is the result of division/modulo arithmetic operators where the divisor is zero? Is it undefined by the spec, null, or +/- infinity? (noting that infinity is only applicable to Single/Double). > Q11. What are the rules for the calculation of the result of modulo where one or both operands are negative? > Q12. What are the rules for scale of the results of arithmetic operators where the operands are decimal? > Q13. Which style of rounding is used by the round function (e.g. round-half-even)? > Q14. Does the 'length' function calculate length according to UTF-8 bytes, UTF-16 characters, or something else? (noting that the CSDL spec defines String as a fixed-length or variable-length sequence of UTF-8 characters, we should just ensure that we have consistent rules for filters). > Q15. Has it been considered to define a 'count' function that would return the number of elements in a structural or navigation property? -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://tools.oasis-open.org/issues/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira

**References**:**[OASIS Issue Tracker] Created: (ODATA-294) Clarifications needed for Filter System Query Option: Operators and Functions***From:*OASIS Issues Tracker <workgroup_mailer@lists.oasis-open.org>

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