TAP - Supported datatypes
Gregory MANTELET
gregory.mantelet at astro.unistra.fr
Fri Nov 8 09:49:48 CET 2024
Hi Stephen,
Actually, your question is half ADQL, half TAP.
Speaking about ADQL, booleans are not yet supported. It means that you
can not write constraints like `a_column = TRUE`. Booleans exists only
as integer values 1 or 0. The best known example is the positional
cross-match syntax `1=CONTAINS(POINT(...), CIRCLE(...))`. However,
there is a plan to support properly booleans in ADQL in a future version.
In the TAP context, nothing really prevents a TAP service to return
boolean values. The datatype applied in such case is undefined in
TAP-1.0. However, in TAP-1.1, datatypes are now explicitly expressed as
VOTable datatypes. The latter provides an explicit `boolean` datatype.
So, if your service fully support TAP-1.1, you should already have the
possibility to return boolean values using this VOTable datatype.
Now, as the developer of VOLLT, I'd like to add a comment about the
`validated types` you extracted. VOLLT/TAP-Lib does not yet support
TAP-1.1. But, I am working on it currently ; it is just a matter of time
; sorry for the long waiting. So, it is true that currently there is no
explicit BOOLEAN values. However, boolean extracted from the database
should be converted automatically by VOLLT into SMALLINT with only two
possible values: 1 and 0. To make this work, in the TAP_SCHEMA, any
boolean column should be defined as SMALLINT (instead of BOOLEAN). That
was the default strategy in VOLLT for TAP-1.0. Once I will have changed
the datatype system of VOLLT (which requires a lot of time and
precautions as it is a core part of my libraries...but it is almost
done), the `boolean` datatype of VOTable will be used automatically by
default. At that moment, the class you are pointing to as "the list of
validated types" will be deprecated and a lot more flexibility will be
possible regarding the datatypes by using the VOTable datatypes. Again,
sorry for this long waiting.
I hope I answered your questions. Of course, anybody else is free to
comment or complete these answers. If you have other questions or
concerns, please, do not hesitate to share them.
Cheers,
Grégory M.
On 07/11/2024 11:35, Stephen Lloyd via dal wrote:
>
> Hi,
>
> TLDR: Are Booleans acceptable data types in TAP and if not, should
> they be converted to another data type?
>
> I’m wondering if anyone can assist with either pointing me to the
> correct documentation containing a definitive list of supported data
> types for TAP please?
>
> I’m currently looking at the Vollt libraries and there seems to be a
> list of validated types
> <https://github.com/gmantele/vollt/blob/master/src/adql/db/DBType.java>
> /SMALLINT/, /INTEGER/, /BIGINT/, /REAL/, /DOUBLE/, /BINARY/,
> /VARBINARY/, /CHAR/, /VARCHAR/, /BLOB/, /CLOB/, /TIMESTAMP/, /POINT/,
> /CIRCLE/, /POLYGON/, /REGION/, /UNKNOWN/, UK/NOWN_NUMERIC/ but no
> BOOLEAN. I have existing database tables/columns that have BOOLEAN
> data types but they get converted to UNKNOWN at runtime due to the
> validation in Vollt.
>
> Should TAP support BOOLEAN or should it be converted to say SMALLINT
> (as a 0/1)?
>
> Thanks,
>
> Stephen Lloyd
>
> Research Software Engineer
>
> University of Manchester
>
> UKSRC
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ivoa.net/pipermail/dal/attachments/20241108/44300df4/attachment.htm>
More information about the dal
mailing list