Difference: ADQL-2_0-Err-2 (1 vs. 10)

Revision 102018-02-23 - MarcoMolinaro

 
META TOPICPARENT name="ADQL-2_0-Next"

ADQL-2.0 Erratum 2: Mathematical Functions' Table issues

Author: Dave Morris

Date last changed: 2018-02-14

Added:
>
>
Date accepted: 2018-02-22
 

Rationale

IVOA DAL mailing list thread on July 2016 highlighted a possible issue with the description of the MOD function. Discussion went on also on this other thread.

Subsequently a different thread highlighted other mismatches between Table 1 (Mathematical functions) descriptions and the ADQL-2.0 grammar.

Here follows what emerged as possible erratum content from those discussions.

MOD function description

Considering what current TAP-1.0 services using ADQL implement and the usual SQL definition of the modulo operator:

M % N = R

with

  • R having the same sign as M
  • |R| is less than |N|
  • M = K * N + R for a given integer K
The definition of mod(x, y) in ADQL-2.0 should be amended to "Returns the remainder of x/y". It should also be made clear, maybe in a future revision, to follow the above rules for the remainder and its sign.

RAND optional seed

ADQL BNF grammar (page 29 of ADQL-2.0) reports the unsigned_integer x to be an optional argument (the seed) to the random mathematical function. This is not made explicit in the description in Table 1.

We suggest to amend the description changing the final "where x is a seed" into "where x is an optional seed" value.

ROUND optional places number

ADQL BNF grammar (pages 29-30 of ADQL-2.0) reports the signed_integer n of ROUND(x, n) to be an optional argument. This signed integer number of places to round the value of x to is not made explicit to be optional in Table 1 description. Also, as per SQL standard, it should default to 0 when not explicitly present.

We suggest to amend the description of round(x, n) in Table 1 by adding a final sentence reading "The integer n is optional and its value should default to 0.".

TRUNCATE optional places number

ADQL BNF grammar (page 30 of ADQL-2.0) reports the signed_integer n of TRUNCATE(x, n) to be an optional argument. This signed integer number of places to truncate the value of x to is not made explicit to be optional in Table 1 description. Also, as per SQL standard, it should default to 0 when not explicitly present.

We suggest to amend the description of truncate(x, n) in Table 1 by adding a final sentence reading "The integer n is optional and its value should default to 0.".

Erratum Content

This erratum changes the description of the mod, rand, round and truncate function in Table 1 on page 8 of the ADQL-2.0 recommendation from

mod(x, y)
    Returns the remainder of y/x.
rand(x)
    Returns a random value between 0.0 and 1.0, where x is a seed value.
round(x, n)
    Rounds double value x to n number of decimal places, with the default
    being to round to the nearest integer. To round to the left of the decimal 
    point, a negative number should be provided.
truncate(x, n)
    Returns the result of truncating the argument x to n decimal places.

to

mod(x, y)
    Returns the remainder of x/y.
rand(x)
    Returns a random value between 0.0 and 1.0.  The optional argument,
    originally intended to provide a random seed, has undefined semantics.
    Query writers are advised to use the form without the argument.
round(x, n)
    Rounds double value x to n number of decimal places, with the default
    being to round to the nearest integer. To round to the left of the decimal 
    point, a negative number should be provided. The integer n is optional
    and its value should default to 0.
truncate(x, n)
    Returns the result of truncating the argument x to n decimal places.
    The integer n is optional and its value should default to 0.

Impact Assessment

The changes proposed by this erratum should impact no existing IVOA resource. Checks against the major TAP services show they already act following the behaviour here above described for the modulo function, while for the remaining 3 issues, all of them simply require some explicit wording in the description to follow the grammar constraints. Checks against a choice of RDBMS-es (PostgreSQL, MySQL, MariaDB, Apache Derby, HyperSQL and Oracle) shows the same behaviour too. See the mail threads referenced in the introduction of this page for details.

<--  
-->

Revision 92018-02-22 - MarcoMolinaro

 
META TOPICPARENT name="ADQL-2_0-Next"

ADQL-2.0 Erratum 2: Mathematical Functions' Table issues

Changed:
<
<
Author: DAL WG
>
>
Author: Dave Morris
  Date last changed: 2018-02-14

Rationale

IVOA DAL mailing list thread on July 2016 highlighted a possible issue with the description of the MOD function. Discussion went on also on this other thread.

Subsequently a different thread highlighted other mismatches between Table 1 (Mathematical functions) descriptions and the ADQL-2.0 grammar.

Here follows what emerged as possible erratum content from those discussions.

MOD function description

Considering what current TAP-1.0 services using ADQL implement and the usual SQL definition of the modulo operator:

M % N = R

with

  • R having the same sign as M
  • |R| is less than |N|
  • M = K * N + R for a given integer K
The definition of mod(x, y) in ADQL-2.0 should be amended to "Returns the remainder of x/y". It should also be made clear, maybe in a future revision, to follow the above rules for the remainder and its sign.

RAND optional seed

ADQL BNF grammar (page 29 of ADQL-2.0) reports the unsigned_integer x to be an optional argument (the seed) to the random mathematical function. This is not made explicit in the description in Table 1.

We suggest to amend the description changing the final "where x is a seed" into "where x is an optional seed" value.

ROUND optional places number

ADQL BNF grammar (pages 29-30 of ADQL-2.0) reports the signed_integer n of ROUND(x, n) to be an optional argument. This signed integer number of places to round the value of x to is not made explicit to be optional in Table 1 description. Also, as per SQL standard, it should default to 0 when not explicitly present.

We suggest to amend the description of round(x, n) in Table 1 by adding a final sentence reading "The integer n is optional and its value should default to 0.".

TRUNCATE optional places number

ADQL BNF grammar (page 30 of ADQL-2.0) reports the signed_integer n of TRUNCATE(x, n) to be an optional argument. This signed integer number of places to truncate the value of x to is not made explicit to be optional in Table 1 description. Also, as per SQL standard, it should default to 0 when not explicitly present.

We suggest to amend the description of truncate(x, n) in Table 1 by adding a final sentence reading "The integer n is optional and its value should default to 0.".

Erratum Content

This erratum changes the description of the mod, rand, round and truncate function in Table 1 on page 8 of the ADQL-2.0 recommendation from

mod(x, y)
    Returns the remainder of y/x.
rand(x)
    Returns a random value between 0.0 and 1.0, where x is a seed value.
round(x, n)
    Rounds double value x to n number of decimal places, with the default
    being to round to the nearest integer. To round to the left of the decimal 
    point, a negative number should be provided.
truncate(x, n)
    Returns the result of truncating the argument x to n decimal places.

to

mod(x, y)
    Returns the remainder of x/y.
rand(x)
    Returns a random value between 0.0 and 1.0.  The optional argument,
    originally intended to provide a random seed, has undefined semantics.
    Query writers are advised to use the form without the argument.
round(x, n)
    Rounds double value x to n number of decimal places, with the default
    being to round to the nearest integer. To round to the left of the decimal 
    point, a negative number should be provided. The integer n is optional
    and its value should default to 0.
truncate(x, n)
    Returns the result of truncating the argument x to n decimal places.
    The integer n is optional and its value should default to 0.

Impact Assessment

The changes proposed by this erratum should impact no existing IVOA resource. Checks against the major TAP services show they already act following the behaviour here above described for the modulo function, while for the remaining 3 issues, all of them simply require some explicit wording in the description to follow the grammar constraints. Checks against a choice of RDBMS-es (PostgreSQL, MySQL, MariaDB, Apache Derby, HyperSQL and Oracle) shows the same behaviour too. See the mail threads referenced in the introduction of this page for details.

<--  
-->

Revision 82018-02-14 - MarcoMolinaro

 
META TOPICPARENT name="ADQL-2_0-Next"

ADQL-2.0 Erratum 2: Mathematical Functions' Table issues

Author: DAL WG

Changed:
<
<
Date last changed: 2017-10-09
>
>
Date last changed: 2018-02-14
 

Rationale

IVOA DAL mailing list thread on July 2016 highlighted a possible issue with the description of the MOD function. Discussion went on also on this other thread.

Subsequently a different thread highlighted other mismatches between Table 1 (Mathematical functions) descriptions and the ADQL-2.0 grammar.

Here follows what emerged as possible erratum content from those discussions.

MOD function description

Considering what current TAP-1.0 services using ADQL implement and the usual SQL definition of the modulo operator:

M % N = R

with

  • R having the same sign as M
  • |R| is less than |N|
  • M = K * N + R for a given integer K
The definition of mod(x, y) in ADQL-2.0 should be amended to "Returns the remainder of x/y". It should also be made clear, maybe in a future revision, to follow the above rules for the remainder and its sign.

RAND optional seed

ADQL BNF grammar (page 29 of ADQL-2.0) reports the unsigned_integer x to be an optional argument (the seed) to the random mathematical function. This is not made explicit in the description in Table 1.

We suggest to amend the description changing the final "where x is a seed" into "where x is an optional seed" value.

ROUND optional places number

ADQL BNF grammar (pages 29-30 of ADQL-2.0) reports the signed_integer n of ROUND(x, n) to be an optional argument. This signed integer number of places to round the value of x to is not made explicit to be optional in Table 1 description. Also, as per SQL standard, it should default to 0 when not explicitly present.

We suggest to amend the description of round(x, n) in Table 1 by adding a final sentence reading "The integer n is optional and its value should default to 0.".

TRUNCATE optional places number

ADQL BNF grammar (page 30 of ADQL-2.0) reports the signed_integer n of TRUNCATE(x, n) to be an optional argument. This signed integer number of places to truncate the value of x to is not made explicit to be optional in Table 1 description. Also, as per SQL standard, it should default to 0 when not explicitly present.

We suggest to amend the description of truncate(x, n) in Table 1 by adding a final sentence reading "The integer n is optional and its value should default to 0.".

Erratum Content

Changed:
<
<
Table 1 on page 8 of the ADQL-2.0 recommendation reports the following descriptions for the hereby discussed mathematical functions:
mod(x, y)
Returns the remainder of y/x.
rand(x)
Returns a random value between 0.0 and 1.0, where x is a seed value.
round(x, n)
Rounds double value x to n number of decimal places, with the default being to round to the nearest integer. To round to the left of the decimal point, a negative number should be provided.
truncate(x, n)
Returns the result of truncating the argument x to n decimal places.
>
>
This erratum changes the description of the mod, rand, round and truncate function in Table 1 on page 8 of the ADQL-2.0 recommendation from
mod(x, y)
    Returns the remainder of y/x.
rand(x)
Added:
>
>
Returns a random value between 0.0 and 1.0, where x is a seed value. round(x, n) Rounds double value x to n number of decimal places, with the default being to round to the nearest integer. To round to the left of the decimal point, a negative number should be provided. truncate(x, n) Returns the result of truncating the argument x to n decimal places.
 
Changed:
<
<
This erratum amends these descriptions, given what's discussed in the rationale of this erratum, substituting them with the following ones:
mod(x, y)
Returns the remainder of x/y.
rand(x)
Returns a random value between 0.0 and 1.0. The optional argument, originally intended to provide a random seed, has undefined semantics. Query writers are advised to use the form without the argument.
round(x, n)
Rounds double value x to n number of decimal places, with the default being to round to the nearest integer. To round to the left of the decimal point, a negative number should be provided. The integer n is optional and its value should default to 0.
truncate(x, n)
Returns the result of truncating the argument x to n decimal places. The integer n is optional and its value should default to 0.
>
>
to

mod(x, y)
    Returns the remainder of x/y.
rand(x)
    Returns a random value between 0.0 and 1.0.  The optional argument,
    originally intended to provide a random seed, has undefined semantics.
Added:
>
>
Query writers are advised to use the form without the argument. round(x, n) Rounds double value x to n number of decimal places, with the default being to round to the nearest integer. To round to the left of the decimal point, a negative number should be provided. The integer n is optional and its value should default to 0. truncate(x, n) Returns the result of truncating the argument x to n decimal places. The integer n is optional and its value should default to 0.
 

Impact Assessment

The changes proposed by this erratum should impact no existing IVOA resource. Checks against the major TAP services show they already act following the behaviour here above described for the modulo function, while for the remaining 3 issues, all of them simply require some explicit wording in the description to follow the grammar constraints. Checks against a choice of RDBMS-es (PostgreSQL, MySQL, MariaDB, Apache Derby, HyperSQL and Oracle) shows the same behaviour too. See the mail threads referenced in the introduction of this page for details.

<--  
-->

Revision 72017-10-09 - MarcoMolinaro

 
META TOPICPARENT name="ADQL-2_0-Next"

ADQL-2.0 Erratum 2: Mathematical Functions' Table issues

Author: DAL WG

Changed:
<
<
Date last changed: 2017-09-28
>
>
Date last changed: 2017-10-09
 

Rationale

IVOA DAL mailing list thread on July 2016 highlighted a possible issue with the description of the MOD function. Discussion went on also on this other thread.

Subsequently a different thread highlighted other mismatches between Table 1 (Mathematical functions) descriptions and the ADQL-2.0 grammar.

Here follows what emerged as possible erratum content from those discussions.

MOD function description

Changed:
<
<
Considering what current TAP-1.0 services using ADQL and the mathematical description of the modulo operator where
>
>
Considering what current TAP-1.0 services using ADQL implement and the usual SQL definition of the modulo operator:
  M % N = R

with

  • R having the same sign as M
  • |R| is less than |N|
  • M = K * N + R for a given integer K
The definition of mod(x, y) in ADQL-2.0 should be amended to "Returns the remainder of x/y". It should also be made clear, maybe in a future revision, to follow the above rules for the remainder and its sign.

RAND optional seed

ADQL BNF grammar (page 29 of ADQL-2.0) reports the unsigned_integer x to be an optional argument (the seed) to the random mathematical function. This is not made explicit in the description in Table 1.

We suggest to amend the description changing the final "where x is a seed" into "where x is an optional seed" value.

ROUND optional places number

ADQL BNF grammar (pages 29-30 of ADQL-2.0) reports the signed_integer n of ROUND(x, n) to be an optional argument. This signed integer number of places to round the value of x to is not made explicit to be optional in Table 1 description. Also, as per SQL standard, it should default to 0 when not explicitly present.

We suggest to amend the description of round(x, n) in Table 1 by adding a final sentence reading "The integer n is optional and its value should default to 0.".

TRUNCATE optional places number

ADQL BNF grammar (page 30 of ADQL-2.0) reports the signed_integer n of TRUNCATE(x, n) to be an optional argument. This signed integer number of places to truncate the value of x to is not made explicit to be optional in Table 1 description. Also, as per SQL standard, it should default to 0 when not explicitly present.

We suggest to amend the description of truncate(x, n) in Table 1 by adding a final sentence reading "The integer n is optional and its value should default to 0.".

Erratum Content

Table 1 on page 8 of the ADQL-2.0 recommendation reports the following descriptions for the hereby discussed mathematical functions:

mod(x, y)
Returns the remainder of y/x.
rand(x)
Returns a random value between 0.0 and 1.0, where x is a seed value.
round(x, n)
Rounds double value x to n number of decimal places, with the default being to round to the nearest integer. To round to the left of the decimal point, a negative number should be provided.
truncate(x, n)
Returns the result of truncating the argument x to n decimal places.

This erratum amends these descriptions, given what's discussed in the rationale of this erratum, substituting them with the following ones:

mod(x, y)
Returns the remainder of x/y.
rand(x)
Returns a random value between 0.0 and 1.0. The optional argument, originally intended to provide a random seed, has undefined semantics. Query writers are advised to use the form without the argument.
round(x, n)
Rounds double value x to n number of decimal places, with the default being to round to the nearest integer. To round to the left of the decimal point, a negative number should be provided. The integer n is optional and its value should default to 0.
truncate(x, n)
Returns the result of truncating the argument x to n decimal places. The integer n is optional and its value should default to 0.

Impact Assessment

The changes proposed by this erratum should impact no existing IVOA resource. Checks against the major TAP services show they already act following the behaviour here above described for the modulo function, while for the remaining 3 issues, all of them simply require some explicit wording in the description to follow the grammar constraints. Checks against a choice of RDBMS-es (PostgreSQL, MySQL, MariaDB, Apache Derby, HyperSQL and Oracle) shows the same behaviour too. See the mail threads referenced in the introduction of this page for details.

<--  
-->

Revision 62017-10-06 - MarkTaylor

 
META TOPICPARENT name="ADQL-2_0-Next"

ADQL-2.0 Erratum 2: Mathematical Functions' Table issues

Author: DAL WG

Date last changed: 2017-09-28

Rationale

IVOA DAL mailing list thread on July 2016 highlighted a possible issue with the description of the MOD function. Discussion went on also on this other thread.

Subsequently a different thread highlighted other mismatches between Table 1 (Mathematical functions) descriptions and the ADQL-2.0 grammar.

Here follows what emerged as possible erratum content from those discussions.

MOD function description

Considering what current TAP-1.0 services using ADQL and the mathematical description of the modulo operator where

M % N = R

with

  • R having the same sign as M
  • |R| is less than |N|
  • M = K * N + R for a given integer K
The definition of mod(x, y) in ADQL-2.0 should be amended to "Returns the remainder of x/y". It should also be made clear, maybe in a future revision, to follow the above rules for the remainder and its sign.

RAND optional seed

ADQL BNF grammar (page 29 of ADQL-2.0) reports the unsigned_integer x to be an optional argument (the seed) to the random mathematical function. This is not made explicit in the description in Table 1.

We suggest to amend the description changing the final "where x is a seed" into "where x is an optional seed" value.

ROUND optional places number

ADQL BNF grammar (pages 29-30 of ADQL-2.0) reports the signed_integer n of ROUND(x, n) to be an optional argument. This signed integer number of places to round the value of x to is not made explicit to be optional in Table 1 description. Also, as per SQL standard, it should default to 0 when not explicitly present.

We suggest to amend the description of round(x, n) in Table 1 by adding a final sentence reading "The integer n is optional and its value should default to 0.".

TRUNCATE optional places number

ADQL BNF grammar (page 30 of ADQL-2.0) reports the signed_integer n of TRUNCATE(x, n) to be an optional argument. This signed integer number of places to truncate the value of x to is not made explicit to be optional in Table 1 description. Also, as per SQL standard, it should default to 0 when not explicitly present.

We suggest to amend the description of truncate(x, n) in Table 1 by adding a final sentence reading "The integer n is optional and its value should default to 0.".

Erratum Content

Table 1 on page 8 of the ADQL-2.0 recommendation reports the following descriptions for the hereby discussed mathematical functions:

mod(x, y)
Returns the remainder of y/x.
rand(x)
Returns a random value between 0.0 and 1.0, where x is a seed value.
round(x, n)
Rounds double value x to n number of decimal places, with the default being to round to the nearest integer. To round to the left of the decimal point, a negative number should be provided.
truncate(x, n)
Returns the result of truncating the argument x to n decimal places.

This erratum amends these descriptions, given what's discussed in the rationale of this erratum, substituting them with the following ones:

mod(x, y)
Returns the remainder of x/y.
rand(x)
Returns a random value between 0.0 and 1.0. The optional argument, originally intended to provide a random seed, has undefined semantics. Query writers are advised to use the form without the argument.
round(x, n)
Rounds double value x to n number of decimal places, with the default being to round to the nearest integer. To round to the left of the decimal point, a negative number should be provided. The integer n is optional and its value should default to 0.
truncate(x, n)
Returns the result of truncating the argument x to n decimal places. The integer n is optional and its value should default to 0.

Impact Assessment

Changed:
<
<
The changes proposed by this erratum should impact no existing IVOA resource. Checks against the major TAP services show they already act following the behaviour here above described for the modulo function, while for the remaining 3 issue, all of them simply require some explicit wording in the description to follow the grammar constrains. Checks against a choice of RDBMS-es (PostgreSQL, MySQL, MariaDB, Apache Derby, HyperSQL and Oracle) shows the same behaviour too. See the mail threads referenced in the introduction of this page for details.
>
>
The changes proposed by this erratum should impact no existing IVOA resource. Checks against the major TAP services show they already act following the behaviour here above described for the modulo function, while for the remaining 3 issues, all of them simply require some explicit wording in the description to follow the grammar constraints. Checks against a choice of RDBMS-es (PostgreSQL, MySQL, MariaDB, Apache Derby, HyperSQL and Oracle) shows the same behaviour too. See the mail threads referenced in the introduction of this page for details.
 
<--  
-->

Revision 52017-09-27 - MarcoMolinaro

 
META TOPICPARENT name="ADQL-2_0-Next"

ADQL-2.0 Erratum 2: Mathematical Functions' Table issues

Author: DAL WG

Changed:
<
<
Date last changed: 2017-05-26
>
>
Date last changed: 2017-09-28
 

Rationale

IVOA DAL mailing list thread on July 2016 highlighted a possible issue with the description of the MOD function. Discussion went on also on this other thread.

Subsequently a different thread highlighted other mismatches between Table 1 (Mathematical functions) descriptions and the ADQL-2.0 grammar.

Here follows what emerged as possible erratum content from those discussions.

MOD function description

Considering what current TAP-1.0 services using ADQL and the mathematical description of the modulo operator where

M % N = R

with

  • R having the same sign as M
  • |R| is less than |N|
  • M = K * N + R for a given integer K
The definition of mod(x, y) in ADQL-2.0 should be amended to "Returns the remainder of x/y". It should also be made clear, maybe in a future revision, to follow the above rules for the remainder and its sign.

RAND optional seed

ADQL BNF grammar (page 29 of ADQL-2.0) reports the unsigned_integer x to be an optional argument (the seed) to the random mathematical function. This is not made explicit in the description in Table 1.

We suggest to amend the description changing the final "where x is a seed" into "where x is an optional seed" value.

ROUND optional places number

ADQL BNF grammar (pages 29-30 of ADQL-2.0) reports the signed_integer n of ROUND(x, n) to be an optional argument. This signed integer number of places to round the value of x to is not made explicit to be optional in Table 1 description. Also, as per SQL standard, it should default to 0 when not explicitly present.

We suggest to amend the description of round(x, n) in Table 1 by adding a final sentence reading "The integer n is optional and its value should default to 0.".

TRUNCATE optional places number

ADQL BNF grammar (page 30 of ADQL-2.0) reports the signed_integer n of TRUNCATE(x, n) to be an optional argument. This signed integer number of places to truncate the value of x to is not made explicit to be optional in Table 1 description. Also, as per SQL standard, it should default to 0 when not explicitly present.

We suggest to amend the description of truncate(x, n) in Table 1 by adding a final sentence reading "The integer n is optional and its value should default to 0.".

Erratum Content

Table 1 on page 8 of the ADQL-2.0 recommendation reports the following descriptions for the hereby discussed mathematical functions:

mod(x, y)
Returns the remainder of y/x.
rand(x)
Returns a random value between 0.0 and 1.0, where x is a seed value.
round(x, n)
Rounds double value x to n number of decimal places, with the default being to round to the nearest integer. To round to the left of the decimal point, a negative number should be provided.
truncate(x, n)
Returns the result of truncating the argument x to n decimal places.

This erratum amends these descriptions, given what's discussed in the rationale of this erratum, substituting them with the following ones:

mod(x, y)
Returns the remainder of x/y.
Changed:
<
<
rand(x)
Returns a random value between 0.0 and 1.0, where x is an optional seed value.
>
>
rand(x)
Returns a random value between 0.0 and 1.0. *The
Added:
>
>
optional argument, originally intended to provide a random seed, has undefined semantics. Query writers are advised to use the form without the argument.*
 
round(x, n)
Rounds double value x to n number of decimal places, with the default being to round to the nearest integer. To round to the left of the decimal point, a negative number should be provided. The integer n is optional and its value should default to 0.
truncate(x, n)
Returns the result of truncating the argument x to n decimal places. The integer n is optional and its value should default to 0.

Impact Assessment

The changes proposed by this erratum should impact no existing IVOA resource. Checks against the major TAP services show they already act following the behaviour here above described for the modulo function, while for the remaining 3 issue, all of them simply require some explicit wording in the description to follow the grammar constrains. Checks against a choice of RDBMS-es (PostgreSQL, MySQL, MariaDB, Apache Derby, HyperSQL and Oracle) shows the same behaviour too. See the mail threads referenced in the introduction of this page for details.

<--  
-->

Revision 42017-05-29 - MarkusDemleitner

 
META TOPICPARENT name="ADQL-2_0-Next"

ADQL-2.0 Erratum 2: Mathematical Functions' Table issues

Author: DAL WG

Date last changed: 2017-05-26

Rationale

IVOA DAL mailing list thread on July 2016 highlighted a possible issue with the description of the MOD function. Discussion went on also on this other thread.

Subsequently a different thread highlighted other mismatches between Table 1 (Mathematical functions) descriptions and the ADQL-2.0 grammar.

Here follows what emerged as possible erratum content from those discussions.

MOD function description

Considering what current TAP-1.0 services using ADQL and the mathematical description of the modulo operator where

M % N = R

with

  • R having the same sign as M
  • |R| is less than |N|
  • M = K * N + R for a given integer K
Deleted:
<
<
 The definition of mod(x, y) in ADQL-2.0 should be amended to "Returns the remainder of x/y". It should also be made clear, maybe in a future revision, to follow the above rules for the remainder and its sign.

RAND optional seed

ADQL BNF grammar (page 29 of ADQL-2.0) reports the unsigned_integer x to be an optional argument (the seed) to the random mathematical function. This is not made explicit in the description in Table 1.

We suggest to amend the description changing the final "where x is a seed" into "where x is an optional seed" value.

ROUND optional places number

ADQL BNF grammar (pages 29-30 of ADQL-2.0) reports the signed_integer n of ROUND(x, n) to be an optional argument. This signed integer number of places to round the value of x to is not made explicit to be optional in Table 1 description. Also, as per SQL standard, it should default to 0 when not explicitly present.

We suggest to amend the description of round(x, n) in Table 1 by adding a final sentence reading "The integer n is optional and its value should default to 0.".

TRUNCATE optional places number

ADQL BNF grammar (page 30 of ADQL-2.0) reports the signed_integer n of TRUNCATE(x, n) to be an optional argument. This signed integer number of places to truncate the value of x to is not made explicit to be optional in Table 1 description. Also, as per SQL standard, it should default to 0 when not explicitly present.

We suggest to amend the description of truncate(x, n) in Table 1 by adding a final sentence reading "The integer n is optional and its value should default to 0.".

Erratum Content

Table 1 on page 8 of the ADQL-2.0 recommendation reports the following descriptions for the hereby discussed mathematical functions:

Changed:
<
<
mod(x, y)
Returns the remainder of y/x.
rand(x)
Returns a random value between 0.0 and 1.0, where x is a seed value.
round(x, n)
Rounds double value x to n number of decimal places, with the default being to round to the nearest integer. To round to the left of the decimal point, a negative number should be provided.
truncate(x, n)
Returns the result of truncating the argument x to n decimal places.
>
>
mod(x, y)
Returns the remainder of y/x.
rand(x)
Returns a random value between 0.0 and 1.0, where x is a seed value.
round(x, n)
Rounds double value x to n number of decimal places, with the default being to round to the nearest integer. To round to the left of the decimal point, a negative number should be provided.
truncate(x, n)
Returns the result of truncating the argument x to n decimal places.
Deleted:
<
<
 This erratum amends these descriptions, given what's discussed in the rationale of this erratum, substituting them with the following ones:
Changed:
<
<
mod(x, y)
Returns the remainder of x/y.
rand(x)
Returns a random value between 0.0 and 1.0, where x is an optional seed value.
round(x, n)
Rounds double value x to n number of decimal places, with the default being to round to the nearest integer. To round to the left of the decimal point, a negative number should be provided. The integer n is optional and its value should default to 0.
>
>
mod(x, y)
Returns the remainder of x/y.
rand(x)
Returns a random value between 0.0 and 1.0, where x is an optional seed value.
round(x, n)
Rounds double value x to n number of decimal places, with the default being to round to the nearest integer. To round to the left of the decimal point, a negative number should be provided. The integer n is optional and its value should default to 0.
truncate(x, n)
Returns the result of truncating the argument x to n decimal places. The integer n is optional and its value should default to 0.
Deleted:
<
<
truncate(x, n)
Returns the result of truncating the argument x to n decimal places. The integer n is optional and its value should default to 0.
 
Changed:
<
<

Impact Assesment

>
>

Impact Assessment

  The changes proposed by this erratum should impact no existing IVOA resource. Checks against the major TAP services show they already act following the behaviour here above described for the modulo function, while for the remaining 3 issue, all of them simply require some explicit wording in the description to follow the grammar constrains. Checks against a choice of RDBMS-es (PostgreSQL, MySQL, MariaDB, Apache Derby, HyperSQL and Oracle) shows the same behaviour too. See the mail threads referenced in the introduction of this page for details.

<--  
-->

Revision 32017-05-26 - MarcoMolinaro

 
META TOPICPARENT name="ADQL-2_0-Next"
Changed:
<
<

ADQL-2.0 Erratum 2 - Mathematical functions' Table issues

>
>

ADQL-2.0 Erratum 2: Mathematical Functions' Table issues

 
Changed:
<
<
IVOA DAL mailing list thread on July 2016 highlighted a possible issue with the description of the MOD function. Discussion went on also on this other thread.
>
>
Author: DAL WG
 
Changed:
<
<
Subsequently a different thread highlighted other mismatches between Table 1 (Mathematical functions) descriptions and the ADQL-2.0 grammar.
>
>
Date last changed: 2017-05-26
 
Changed:
<
<

Erratum Content

>
>

Rationale

 
Changed:
<
<
Table 1 on page 8 of the ADQL-2.0 recommendation reports
>
>
IVOA DAL mailing list thread on July 2016 highlighted a possible issue with the description of the MOD function. Discussion went on also on this other thread.
Deleted:
<
<
issue Name Argument data type Return data type Description
1 mod(x, y) double double Returns the remainder of y/x.
2 rand(x) integer double Returns a random value between 0.0 and 1.0, where x is a seed value.
3 round(x, n) x double, n integer double Rounds double value x to n number of decimal places, with the default being to round to the nearest integer. To round to the left of the decimal point, a negative number should be provided.
4 truncate(x, n) x double, n integer double Returns the result of truncating the argument x to n decimal places.
 
Changed:
<
<
The descriptions reported in the above table are ambiguous with respect to the ADQL grammar or are conflicting with SQL definitions.
>
>
Subsequently a different thread highlighted other mismatches between Table 1 (Mathematical functions) descriptions and the ADQL-2.0 grammar.
Deleted:
<
<
Issue 1 seems to conflict with SQL (92, 2003) definitions and, as well, the behaviour of the existing TAP services, suggesting that x and y should be swapped in the function description. Issue 2 description does not report x to be optional. Issues 3 & 4 descriptions do not report that n is optional and that it should default to 0.
 
Changed:
<
<

Rationale

>
>
Here follows what emerged as possible erratum content from those discussions.
 
Changed:
<
<

(issue 1) MOD function description

>
>
MOD function description
Deleted:
<
<
Considering what current TAP services using ADQL and the mathematical description of the modulo operator where
 
Added:
>
>
Considering what current TAP-1.0 services using ADQL and the mathematical description of the modulo operator where
 M % N = R

with

  • R having the same sign as M
  • |R| is less than |N|
  • M = K * N + R for a given integer K
Changed:
<
<
The definition of mod(x, y) in ADQL-2.0 should be amended to "Returns the remainder of x/y". It should also be made clear, maybe in a future revision, to follow the above rules for the remainder and its sign.
>
>
The definition of mod(x, y) in ADQL-2.0 should be amended to "Returns the remainder of x/y". It should also be made clear, maybe in a future revision, to follow the above rules for the remainder and its sign.
 
Changed:
<
<

(issue 2) RAND optional seed

>
>
RAND optional seed
Deleted:
<
<
ADQL BNF grammar (page 29 of ADQL-2.0) reports the x to be an optional argument (the seed) to the random mathematical function. This is not made explicit in the description in Table 1.
 
Added:
>
>
ADQL BNF grammar (page 29 of ADQL-2.0) reports the unsigned_integer x to be an optional argument (the seed) to the random mathematical function. This is not made explicit in the description in Table 1.
 We suggest to amend the description changing the final "where x is a seed" into "where x is an optional seed" value.
Changed:
<
<

(issue 3) ROUND optional places number

>
>
ROUND optional places number
Deleted:
<
<
ADQL BNF grammar (pages 29-30 of ADQL-2.0) reports the n of ROUND(x, n) to be an optional argument. This signed integer number of places to round the value of x to is not made explicit to be optional in Table 1 description. Also, as per SQL standard, it should default to 0 when not explicitly present.
 
Added:
>
>
ADQL BNF grammar (pages 29-30 of ADQL-2.0) reports the signed_integer n of ROUND(x, n) to be an optional argument. This signed integer number of places to round the value of x to is not made explicit to be optional in Table 1 description. Also, as per SQL standard, it should default to 0 when not explicitly present.
 We suggest to amend the description of round(x, n) in Table 1 by adding a final sentence reading "The integer n is optional and its value should default to 0.".
Changed:
<
<

(issue 4) TRUNCATE optional places number

>
>
TRUNCATE optional places number
Deleted:
<
<
ADQL BNF grammar (page 30 of ADQL-2.0) reports the n of TRUNCATE(x, n) to be an optional argument. This signed integer number of places to truncate the value of x to is not made explicit to be optional in Table 1 description. Also, as per SQL standard, it should default to 0 when not explicitly present.
 
Added:
>
>
ADQL BNF grammar (page 30 of ADQL-2.0) reports the signed_integer n of TRUNCATE(x, n) to be an optional argument. This signed integer number of places to truncate the value of x to is not made explicit to be optional in Table 1 description. Also, as per SQL standard, it should default to 0 when not explicitly present.
 We suggest to amend the description of truncate(x, n) in Table 1 by adding a final sentence reading "The integer n is optional and its value should default to 0.".
Added:
>
>

Erratum Content

Table 1 on page 8 of the ADQL-2.0 recommendation reports the following descriptions for the hereby discussed mathematical functions:

mod(x, y)
Returns the remainder of y/x.
rand(x)
Returns a random value between 0.0 and 1.0, where x is a seed value.
round(x, n)
Rounds double value x to n number of decimal places, with the default being to round to the nearest integer. To round to the left of the decimal point, a negative number should be provided.
truncate(x, n)
Returns the result of truncating the argument x to n decimal places.
This erratum amends these descriptions, given what's discussed in the rationale of this erratum, substituting them with the following ones:
mod(x, y)
Returns the remainder of x/y.
rand(x)
Returns a random value between 0.0 and 1.0, where x is an optional seed value.
round(x, n)
Rounds double value x to n number of decimal places, with the default being to round to the nearest integer. To round to the left of the decimal point, a negative number should be provided. The integer n is optional and its value should default to 0.
truncate(x, n)
Returns the result of truncating the argument x to n decimal places. The integer n is optional and its value should default to 0.
 

Impact Assesment

The changes proposed by this erratum should impact no existing IVOA resource. Checks against the major TAP services show they already act following the behaviour here above described for the modulo function, while for the remaining 3 issue, all of them simply require some explicit wording in the description to follow the grammar constrains. Checks against a choice of RDBMS-es (PostgreSQL, MySQL, MariaDB, Apache Derby, HyperSQL and Oracle) shows the same behaviour too. See the mail threads referenced in the introduction of this page for details.

<--  
-->

Revision 22016-08-12 - MarcoMolinaro

 
META TOPICPARENT name="ADQL-2_0-Next"
Changed:
<
<

ADQL-2.0 Erratum 2 - MOD function description

>
>

ADQL-2.0 Erratum 2 - Mathematical functions' Table issues

 
Changed:
<
<
IVOA DAL mailing list thread on July 2016 highlighted a possible issue with the description of the MOD function.
>
>
IVOA DAL mailing list thread on July 2016 highlighted a possible issue with the description of the MOD function. Discussion went on also on this other thread.
 
Added:
>
>
Subsequently a different thread highlighted other mismatches between Table 1 (Mathematical functions) descriptions and the ADQL-2.0 grammar.
 

Erratum Content

Table 1 on page 8 of the ADQL-2.0 recommendation reports

Changed:
<
<
Name Argument data type Return data type Description
mod(x, y) double double Returns the remainder of y/x.
This seems to conflict with SQL (92, 2003) definitions and, as well, the behaviour of the existing TAP services, suggesting that x and y should be swapped in the function description.
>
>
issue Name Argument data type Return data type Description
1 mod(x, y) double double Returns the remainder of y/x.
2 rand(x) integer double Returns a random value between 0.0 and 1.0, where x is a seed value.
Added:
>
>
3 round(x, n) x double, n integer double Rounds double value x to n number of decimal places, with the default being to round to the nearest integer. To round to the left of the decimal point, a negative number should be provided.
4 truncate(x, n) x double, n integer double Returns the result of truncating the argument x to n decimal places.
 
Added:
>
>
The descriptions reported in the above table are ambiguous with respect to the ADQL grammar or are conflicting with SQL definitions. Issue 1 seems to conflict with SQL (92, 2003) definitions and, as well, the behaviour of the existing TAP services, suggesting that x and y should be swapped in the function description. Issue 2 description does not report x to be optional. Issues 3 & 4 descriptions do not report that n is optional and that it should default to 0.
 

Rationale

Added:
>
>

(issue 1) MOD function description

 Considering what current TAP services using ADQL and the mathematical description of the modulo operator where

M % N = R

with

  • R having the same sign as M
  • |R| is less than |N|
  • M = K * N + R for a given integer K

The definition of mod(x, y) in ADQL-2.0 should be amended to "Returns the remainder of x/y". It should also be made clear, maybe in a future revision, to follow the above rules for the remainder and its sign.

Added:
>
>

(issue 2) RAND optional seed

ADQL BNF grammar (page 29 of ADQL-2.0) reports the x to be an optional argument (the seed) to the random mathematical function. This is not made explicit in the description in Table 1.

We suggest to amend the description changing the final "where x is a seed" into "where x is an optional seed" value.

(issue 3) ROUND optional places number

ADQL BNF grammar (pages 29-30 of ADQL-2.0) reports the n of ROUND(x, n) to be an optional argument. This signed integer number of places to round the value of x to is not made explicit to be optional in Table 1 description. Also, as per SQL standard, it should default to 0 when not explicitly present.

We suggest to amend the description of round(x, n) in Table 1 by adding a final sentence reading "The integer n is optional and its value should default to 0.".

(issue 4) TRUNCATE optional places number

ADQL BNF grammar (page 30 of ADQL-2.0) reports the n of TRUNCATE(x, n) to be an optional argument. This signed integer number of places to truncate the value of x to is not made explicit to be optional in Table 1 description. Also, as per SQL standard, it should default to 0 when not explicitly present.

We suggest to amend the description of truncate(x, n) in Table 1 by adding a final sentence reading "The integer n is optional and its value should default to 0.".

 

Impact Assesment

Changed:
<
<
The change proposed by this erratum should impact no existing IVOA resource. Checks against the major TAP services shows they already act following the behaviour here above described. Checks against a choice of RDBMS-es (PostgreSQL, MySQL, MariaDB, Apache Derby, HyperSQL and Oracle) shows the same bahaviour too. See the mail thread referenced in the introduction of this page for details.
>
>
The changes proposed by this erratum should impact no existing IVOA resource. Checks against the major TAP services show they already act following the behaviour here above described for the modulo function, while for the remaining 3 issue, all of them simply require some explicit wording in the description to follow the grammar constrains. Checks against a choice of RDBMS-es (PostgreSQL, MySQL, MariaDB, Apache Derby, HyperSQL and Oracle) shows the same behaviour too. See the mail threads referenced in the introduction of this page for details.
 
<--  
-->

Revision 12016-07-07 - MarcoMolinaro

 
META TOPICPARENT name="ADQL-2_0-Next"

ADQL-2.0 Erratum 2 - MOD function description

IVOA DAL mailing list thread on July 2016 highlighted a possible issue with the description of the MOD function.

Erratum Content

Table 1 on page 8 of the ADQL-2.0 recommendation reports

Name Argument data type Return data type Description
mod(x, y) double double Returns the remainder of y/x.
This seems to conflict with SQL (92, 2003) definitions and, as well, the behaviour of the existing TAP services, suggesting that x and y should be swapped in the function description.

Rationale

Considering what current TAP services using ADQL and the mathematical description of the modulo operator where

M % N = R

with

  • R having the same sign as M
  • |R| is less than |N|
  • M = K * N + R for a given integer K

The definition of mod(x, y) in ADQL-2.0 should be amended to "Returns the remainder of x/y". It should also be made clear, maybe in a future revision, to follow the above rules for the remainder and its sign.

Impact Assesment

The change proposed by this erratum should impact no existing IVOA resource. Checks against the major TAP services shows they already act following the behaviour here above described. Checks against a choice of RDBMS-es (PostgreSQL, MySQL, MariaDB, Apache Derby, HyperSQL and Oracle) shows the same bahaviour too. See the mail thread referenced in the introduction of this page for details.

<--  
-->
 
This site is powered by the TWiki collaboration platform Powered by Perl This site is powered by the TWiki collaboration platformCopyright © 2008-2022 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback