[TAP] data type for column metadata

Patrick Dowler patrick.dowler at nrc-cnrc.gc.ca
Tue Mar 24 11:08:52 PDT 2009


On 2009-03-24 09:54:53 Gerard wrote:
> I have made a table comparing various SQL-like datatypes in the wiki
> http://www.ivoa.net/cgi-bin/twiki/bin/view/IVOA/GerardLemsonADQLDataTypes.
> To me it seems that the JDBC types provide a nice list, as Doug also once
> remarked:
>
> BOOLEAN
> BIGINT
> BLOB
> CHAR(P)
> CLOB
> DATE
> DECIMAL(P,S)
> FLOAT(P)
> INTEGER
> NCHAR(P)
> NUMERIC(P,S)
> NVARCHAR(P)
> REAL
> TIME
> TIMESTAMP
> VARCHAR(P)

Thanks Gerard - you are right that the more immediate issue is the type system 
in the TAP metadata. Mapping that to VOTable will be needed, but is not 
fundamental. 

When I look at the java.sql.Types class, I also see constants for 

DOUBLE - also an ADQL reserved word
SMALLINT - also an ADQL reserved word

BINARY - not an ADQL reserved word
VARBINARY - not an ADQL reserved word

Plus we would have to add at least one construct for region, maybe two:

POINT     aka coordinate system + coordinates
REGION  aka coordinate system + some shape

I think we need both types because some functions (COORDSYS, COORD1, COORD2) 
take only a POINT as an argument. The other geometric functions are still 
useful if we consider them as utility functions that create these two types 
of things.

For simplicity, we could make a shorter list and avoid some of the intricacies 
(for the first version, anyway). From the above types, I have made lots of 
use of the ones that map to primitive types as well as VARCHAR, VARBINARY, 
and TIMESTAMP. I have never found a good use for the separate TIME and DATE, 
nor the arbitrary precision numeric values and rarely/never use fixed size 
CHAR. So my short-list would include:

BOOLEAN
INTEGER
BIGINT
REAL
DOUBLE
TIMESTAMP
VARCHAR
VARBINARY
POINT
REGION

my 2c,

-- 

Patrick Dowler
Tel/Tél: (250) 363-0044
Canadian Astronomy Data Centre
National Research Council Canada
5071 West Saanich Road
Victoria, BC V9E 2M7

Centre canadien de donnees astronomiques
Conseil national de recherches Canada
5071, chemin West Saanich
Victoria (C.-B.) V9E 2M7



More information about the dal mailing list