A proposal for vector math in ADQL | ||||||||
Changed: | ||||||||
< < | With tables containing massive amounts of vectors (e.g., the collections of low-resolution spectra within Gaia DR3 or the Digitised Byurakan Surveys), giving TAP users a toolset to do server-side work with arrays becomes highly desirable and will significantly enhance the power of ADQL to do server-side analyses. This is an attempt to provide a baseline feature set for that. | |||||||
> > | With tables containing massive amounts of vectors becoming common (e.g., the collections of low-resolution spectra within Gaia DR3 or the Digitised Byurakan Surveys), giving TAP users a toolset to do server-side work with arrays becomes highly desirable and will significantly enhance the power of ADQL to do server-side analyses. This is an attempt to provide a baseline feature set for that. | |||||||
TAP servers supporting this should declare that by defining a language feature. While no IVOA specification exists for array operations, use the VECTORMATH key from GAVO's ADQL extensions standards record, like this:
<languageFeatures type="ivo://org.gavo.dc/std/exts#extra-adql-keywords"> <feature> <form>VECTORMATH</form> <description>You can compute with vectors here. See https://wiki.ivoa.net/twiki/bin/view/IVOA/ADQLVectorMath for an overview of the functions and operators available. </description> </feature> </languageFeatures> | ||||||||
Added: | ||||||||
> > | Element AccessTo access an element of a vector, write[element-index] , where element-index is an integer-valued expression. In keeping with common SQL practices (and regrettably working against most programming languages), indexes in ADQL are 1-based (rather than 0-based). That is, the first element of an array with N elements has the index 1 and the last element has the index N.
Again in keeping with common SQL practices, accessing elements outside of that range gives NULL. | |||||||
Basic Math
| ||||||||
Changed: | ||||||||
< < | ||||||||
> > | ||||||||
| ||||||||
Added: | ||||||||
> > |
Array AggregationThese are functions that work like SQL aggregate functions, just on the elements of arrays. These ought to return the types of the elements of the argument (real, double precision, integers).
| |||||||
<--
|