ADQL erratum

Markus Demleitner msdemlei at ari.uni-heidelberg.de
Thu Mar 6 04:46:59 PST 2014


Dear DAL list,

Sorry for disturbing again, but following up to the Errata discussion
I have another erratum that could serve as a model, this time for
http://www.ivoa.net/documents/latest/ADQL.html a.k.a. ADQL 2.0.

The trouble is that the text suggests round(x, n) has two mandatory
arguments, whereas the grammar specifies

  math_function ::= ...| ROUND(<left_paren> <numeric_value_expression>
    [ <comma> <signed_integer>] <right_paren> | ...

i.e., ROUND takes either one or two arguments.  The same problem
exists for TRUNCATE.

As far as I know, ADQL does not define precedence of either prose or
grammar, so we need to resolve that contradiction.

There is something to be said for forcing the two-argument form, in
particular that ROUND and TRUNCATE are the only two functions that
exhibit this kind of variadic argument structure (RAND being variadic
as well, but with a different signature and function).

On the other hand, the single-argument form is the only one
understood by PostgreSQL (and, I would suppose, several other DBs);
outlawing it in ADQL is needlessly building more hurdles for smooth
transistion between SQL dialects, as no compatible form at all would
exist.  And from the GAVO experience, I would say implementation
effort is proportional wrt the effect of maintaining a common
denominator between ADQL and other SQL dialects.

Hence, I'd propose as an erratum to ADQL:

  On page 8, round(x, n) should be replaced by round(x[, n]) and
  truncate(x, n) by truncate(x[, n]) to make the definitions
  compatible with the grammar in Appendix A.  The descriptive texts
  should, in consequence, be amended with: "The second argument n is
  optional, defaulting to 0".


Cheers,

     Markus




More information about the dal mailing list