Working on TAP and ADQL in Trieste we (actually Sonia) found the following discrepancy/issue
ADQL seems to support a query like
SELECT "size"/2 AS half_size FROM TAP_SCHEMA.columns
while it seems not to support
SELECT "size" = 1 AS is_size_1 FROM TAP_SCHEMA.columns
At least Gregory's library (and TOPCAT, but IIRC TOPCAT uses Gregory's ADQL lib for validation) does so and it seems correct with respect to ADQL-2.0.
However in ADQL-2.1 the SELECT clause allows a <value_expression> that can be also a <boolean_value_expression>. This latter, however, contains no <boolean_term> and so disallows the above second query. That boolean_term would allow the SELECT to contain expressions like the above, exactly like it is in a WHERE clause (see <search_condition> definition).
We are wondering whether this is the intended behaviour or if it fits into the BNF-issues' list.
There's also the <boolean_function> BNF term (pg.56 in ADQL-2.1) that is blank, to complicate the view.
I'd like your opinion however, just to know if we can imagine to use boolean valued virtual columns (e.g.
like an a = value AS vcol) in the future or not (we already have possible alternatives).
Email from Marco molinaro@oats.inaf.it and Sonia zorba@oats.inaf.it
2018-01-25
Working on TAP and ADQL in Trieste we (actually Sonia) found the following discrepancy/issue
ADQL seems to support a query like
while it seems not to support
At least Gregory's library (and TOPCAT, but IIRC TOPCAT uses Gregory's ADQL lib for validation) does so and it seems correct with respect to ADQL-2.0.
However in ADQL-2.1 the
SELECTclause allows a<value_expression>that can be also a<boolean_value_expression>. This latter, however, contains no<boolean_term>and so disallows the above second query. That boolean_term would allow theSELECTto contain expressions like the above, exactly like it is in aWHEREclause (see<search_condition>definition).We are wondering whether this is the intended behaviour or if it fits into the BNF-issues' list.
There's also the <boolean_function> BNF term (pg.56 in ADQL-2.1) that is blank, to complicate the view.
I'd like your opinion however, just to know if we can imagine to use boolean valued virtual columns (e.g.
like an
a = value AS vcol) in the future or not (we already have possible alternatives).