ADQL-2.1 internal draft

Markus Demleitner msdemlei at ari.uni-heidelberg.de
Wed Jun 10 09:41:54 CEST 2015


Hi Walter,

On Tue, Jun 09, 2015 at 04:53:26PM -0700, Walter Landry wrote:
> 2) I do not understand the syntax for IN_UNIT().  Shouldn't there be
>    three arguments (value, units_from, units_to) and not two?

No, the whole point is that query writers don't have to assume units
in the query but let the database (or rather the translation layer)
work it out for them.

There are two reasons I've proposed this:

(1) people get unit conversions wrong all the time, and the computer
is much better reliably tracing units than humans are; also, it helps
writing a bit more generic queries

(2) if people do manual unit conversions, there's no way a computer
can reliably figure out the new unit, so your metadata is hosed.

To satisfy both cases, it really needs to be a two-arg function.

> 4) Can we put the math and trig functions into the optional
>    components?  Most of them are not implemented in sqlite.

...but they're reasonably easy to retrofit, no?  In general, I'm
against optional features, as they are a big liability on
clients/users (that have to figure out where they are available).
The code for adding trig to sqlite only needs to be written once, on
the other hand (probably already has several times).

> 5) Why are we making new function names BIT_AND, BIT_OR, etc?  Why not
>    just use the operators?  It is what everyone but Oracle and
>    Informix implement, and they use different names anyway.

...but operators are harder to parse (precedence!  Left-recursive
rules!), and it's easier for a machine to go from prefix notation to
infix than the other way round.  I'm all for functions.

Cheers,

           Markus



More information about the dal mailing list