<html>
<head>
</head>
<body style="font-variant: normal; font-size: 12pt; margin-right: 4px; margin-top: 4px; font-weight: normal; line-height: normal; font-family: Lucida Grande; font-style: normal; margin-left: 4px; margin-bottom: 1px">
<p style="margin-bottom: 0; margin-top: 0">
<font size="3" face="Lucida Grande">Hi Mark,</font> </p>
<br>
<p style="margin-bottom: 0; margin-top: 0">
<font size="3" face="Lucida Grande">You could take a look at Casacore's TaQL, the query language for its tables. It uses array syntax similar to Python.</font> </p>
<p style="margin-bottom: 0; margin-top: 0">
<font size="3" face="Lucida Grande">I understood that an ADQL query command is parsed and rewritten to a command for the underlying query language. That should make it possible to use python-like array syntax and rewrite it to UDFs as needed. Probably not needed for PostgreSQL that supports arrays.</font> </p>
<p style="margin-bottom: 0; margin-top: 0">
<font size="3" face="Lucida Grande">Note that TaQL also support units in a natural way.</font> </p>
<p style="margin-bottom: 0; margin-top: 0">
<font size="3" face="Lucida Grande">See </font><font size="3" color="#0000ff" face="Lucida Grande"><i><u><a href="http://casacore.github.io/casacore-notes/199.html">http://casacore.github.io/casacore-notes/199.html</a></u></i></font><font size="3" face="Lucida Grande"></font> </p>
<br>
<p style="margin-bottom: 0; margin-top: 0">
<font size="3" face="Lucida Grande">Cheers,</font> </p>
<p style="margin-bottom: 0; margin-top: 0">
<font size="3" face="Lucida Grande">ger</font><br><br>>>> Mark Taylor <M.B.Taylor@bristol.ac.uk> 04-Jul-17 13:43 >>><br>Dear DAL,<br><br>Upcoming releases of the Gaia catalogue will contain some<br>array-valued columns in the source catalogues, things like<br>time series, spectra and correlation matrices.<br>TAP does not prevent array-valued columns, but as far as<br>I know there is no standard way to access array elements<br>within ADQL queries.  In DPAC we are considering ways to allow this.<br><br>We can define User-Defined Functions for this purpose, and<br>some experimental functionality along these lines has been<br>implemented.  But we're interested in input from the IVOA:<br><br>   - have other people encountered this and come up with solutions<br>     that we can copy?<br><br>   - should we try to come up with something (a de facto standard)<br>     that can be used by other services?<br><br>   - is there a case for language support for these features in<br>     a future version of ADQL?<br><br>Here is the initial discussion item reported by Alcione Mora from<br>the DPAC issue tracking system (ref for DPAC insiders: C9GACS-239):<br><br>   Experimental support for array functions has been added to Gaia Archive<br>   v1.3.0. Array types are supported as valid output formats. In addition,<br>   some user defined functions have been defined for direct manipulation,<br>   most notably (see Archive help):<br><br>   GET_DOUBLE_ARRAY_ELEMENT(array,indexes): Returns the selected element<br>   from the array of double precision values, where:<br><br>      - array [double]:<br>           Input array<br>      - indexes [string]:<br>           String with the selected indexes with the format '[i][j]..'<br><br>   The syntax is functional, but should be considered a work in progress<br>   until DR2.<br><br>   Extra functionality is needed Some suggestions to discuss include<br>   the following:<br><br>      - get_length(array_column, any type), null for null input cell<br>      - create_double_array(list_of_columns), autocasting<br>      - create_int_array(list_of_columns), autocasting<br>      - Is ADQL function overload supported? I could not find<br>        any reference in ADQL and TAPRegExt (neither allowing nor<br>        forbidding). If yes, GET_ARRAY_ELEMENT should be implemented using<br>        a single function name for all data types transparently to the<br>        user. If not, consider some of the following six bullet points<br>      - Similar functions for float, long, int, byte and boolean<br>        get_double and get_float should accept all numeric types as input<br>        (automatic casting)<br>      - get_long should accept long, int, byte and boolean (1=true, 0=false)<br>      - get_int should accept int and byte and boolean (1=true, 0=false)<br>      - get_byte should accept byte and boolean (1=true, 0=false)<br>      - Alternatively or complementary, the CAST ADQL 2.1 optional<br>        function could be implemented<br><br>If anyone in VO-land has input on this, we'd be pleased to hear it,<br>so we can do something re-usable or re-used as much as possible.<br>Otherwise, we'll go ahead and do whatever looks like a best fit<br>to Gaia requirements.<br><br>Thanks<br><br>Mark<br><br>--<br>Mark Taylor   Astronomical Programmer   Physics, Bristol University, UK<br>m.b.taylor@bris.ac.uk +44-117-9288776  <a href="http://www.star.bris.ac.uk/~mbt/">http://www.star.bris.ac.uk/~mbt/</a><br>
</p>
</body>
</html>