firethorn

changeset 4296:d54e9c2efbe9 2.1.35-stv-issue-1182

Updated fixes for issue #1182 / Added Notes on new tests
author Stelios <stv@roe.ac.uk>
date Thu Mar 12 22:28:48 2020 +0200 (11 months ago)
parents 0be118e0b007
children 1cca1fc1f694
files doc/notes/stv/20200308-Testing-1182.txt doc/notes/stv/20200312-Testing-1182.txt firethorn-core/src/main/java/uk/ac/roe/wfau/firethorn/meta/adql/AdqlColumn.java firethorn-webapp/src/main/java/uk/ac/roe/wfau/firethorn/webapp/votable/AbstractTableController.java firethorn-webapp/src/main/java/uk/ac/roe/wfau/firethorn/webapp/votable/BaseTableDataTableController.java firethorn-webapp/src/main/java/uk/ac/roe/wfau/firethorn/webapp/votable/BaseTableVOTableController.java
line diff
     1.1 --- a/doc/notes/stv/20200308-Testing-1182.txt	Sun Mar 08 11:53:10 2020 +0000
     1.2 +++ b/doc/notes/stv/20200308-Testing-1182.txt	Thu Mar 12 22:28:48 2020 +0200
     1.3 @@ -553,3 +553,48 @@
     1.4  
     1.5  ## Some (unrelated errors), issue for them created in Redmine (http://redmine.roe.ac.uk/issues/1183)
     1.6  
     1.7 +
     1.8 +
     1.9 +
    1.10 +## Test4: Run our own validator
    1.11 +## ---------------------------------------------------------------------------------------
    1.12 +
    1.13 +
    1.14 +## From ftpy container run:
    1.15 +
    1.16 +python3 -c "import firethorn_utils.tap_validator as validator;validator.main()" -ft=http://gillian:8080/firethorn -r=376723 -u=Po7gi9wahLi5sheokoit -p=iengii1Eigiekootahzu -g=fu6us6baiNgie7rah5se -m=sync
    1.17 +--- Starting validation on Resource: http://gillian:8080/firethorn/adql/resource/376723---
    1.18 +...
    1.19 +
    1.20 +Exceptions: 
    1.21 +{'BestDR7.Unknown': '<urlopen error timed out>', 'BestDR9.Sky': '<urlopen error timed out>', 'BestDR9.PhotoPrimary': '<urlopen error timed out>', 'BestDR9.neighbors': '<urlopen error timed out>'}
    1.22 +
    1.23 +
    1.24 +## Test completed, but a few exceptions, with time out error messages
    1.25 +## Run queries on those tables to check
    1.26 +
    1.27 +
    1.28 +curl -L "http://localhost:8080/firethorn/tap/376723/sync?QUERY=SELECT+TOP+5+%2A+FROM+BestDR7.Unknown&REQUEST=doQuery&LANG=ADQL&FORMAT=VOTABLE"
    1.29 +..
    1.30 +<TD><TD>-9999.0</TD><TD>-9999.0</TD><TD>-9999.0</TD><TD>-9999.0</TD></TR></TABLEDATA></DATA></TABLE></RESOURCE></VOTABLE>
    1.31 +## Query seems to have worked fine
    1.32 +
    1.33 +
    1.34 +
    1.35 +curl -L "http://localhost:8080/firethorn/tap/376723/sync?QUERY=SELECT+TOP+5+%2A+FROM+BestDR9.Sky&REQUEST=doQuery&LANG=ADQL&FORMAT=VOTABLE"
    1.36 +..
    1.37 +</FIELD><DATA><TABLEDATA></TABLEDATA></DATA></TABLE></RESOURCE></VOTABLE>
    1.38 +## Query completed, but empty table
    1.39 +
    1.40 +
    1.41 +
    1.42 +curl -L "http://localhost:8080/firethorn/tap/376723/sync?QUERY=SELECT+TOP+5+%2A+FROM+BestDR9.PhotoPrimary&REQUEST=doQuery&LANG=ADQL&FORMAT=VOTABLE"
    1.43 +..
    1.44 +<TD>4.413178758876864E9</TD><TD>4.413178830610624E9</TD><TD>4.413178974039232E9</TD></TR></TABLEDATA></DATA></TABLE></RESOURCE></VOTABLE>
    1.45 +## Query seems to have worked fine
    1.46 +
    1.47 +
    1.48 +curl -L "http://localhost:8080/firethorn/tap/376723/sync?QUERY=SELECT+TOP+5+%2A+FROM+BestDR9.neighbors&REQUEST=doQuery&LANG=ADQL&FORMAT=VOTABLE"
    1.49 +..
    1.50 +<TD>0.14231449259650197</TD><TD>6</TD><TD>3</TD><TD>2</TD><TD>2</TD></TR></TABLEDATA></DATA></TABLE></RESOURCE></VOTABLE>
    1.51 +## Query seems to have worked fine
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/doc/notes/stv/20200312-Testing-1182.txt	Thu Mar 12 22:28:48 2020 +0200
     2.3 @@ -0,0 +1,556 @@
     2.4 +#
     2.5 +# <meta:header>
     2.6 +#   <meta:licence>
     2.7 +#     Copyright (c) 2018, ROE (http://www.roe.ac.uk/)
     2.8 +#
     2.9 +#     This information is free software: you can redistribute it and/or modify
    2.10 +#     it under the terms of the GNU General Public License as published by
    2.11 +#     the Free Software Foundation, either version 3 of the License, or
    2.12 +#     (at your option) any later version.
    2.13 +#
    2.14 +#     This information is distributed in the hope that it will be useful,
    2.15 +#     but WITHOUT ANY WARRANTY; without even the implied warranty of
    2.16 +#     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    2.17 +#     GNU General Public License for more details.
    2.18 +#  
    2.19 +#     You should have received a copy of the GNU General Public License
    2.20 +#     along with this program.  If not, see <http://www.gnu.org/licenses/>.
    2.21 +#   </meta:licence>
    2.22 +# </meta:header>
    2.23 +#
    2.24 +#
    2.25 +
    2.26 +##########################################################
    2.27 +#####         Notes on Testing fix for 1182          #####
    2.28 +##########################################################
    2.29 +
    2.30 +
    2.31 +## Create OSA-TAP service in ftpy
    2.32 +
    2.33 +## From ftpy Docker container (docker-compose --file "docker-compose.yml" run firethorn-py)
    2.34 +
    2.35 +
    2.36 +python3
    2.37 +
    2.38 +import firethorn
    2.39 +import firethorn_utils.configurator as configur
    2.40 +ft = firethorn.Firethorn(endpoint="http://gillian:8080/firethorn")
    2.41 +ft.login(firethorn.config.adminuser, firethorn.config.adminpass, firethorn.config.admingroup)
    2.42 +configurator =  configur.Configurator(ft)
    2.43 +configurator.load_resources("/home/firethorn.py/firethorn/data/osa-tap.json")
    2.44 +Importing JDBC Schema: ATLASDR1
    2.45 +Importing JDBC Schema: ATLASDR2
    2.46 +Importing JDBC Schema: ATLASDR3
    2.47 +Importing JDBC Schema: 2MASS
    2.48 +Importing JDBC Schema: 2XMM
    2.49 +Importing JDBC Schema: WISE
    2.50 +Importing JDBC Schema: VIKINGDR3
    2.51 +Importing JDBC Schema: VHSDR1
    2.52 +Importing JDBC Schema: MGC
    2.53 +Importing JDBC Schema: GLIMPSE
    2.54 +Importing JDBC Schema: FIRST
    2.55 +Importing JDBC Schema: DENIS
    2.56 +Importing JDBC Schema: SDSSDR9
    2.57 +TAP Service available at: http://gillian:8080/firethorn/tap/39559/
    2.58 +
    2.59 +## Added SDSSDR9 to the list to test a specific table with BYTE columns
    2.60 +
    2.61 +
    2.62 +## -----------------------------
    2.63 +## Test with ftpy
    2.64 +
    2.65 +
    2.66 +resource=ft.firethorn_engine.select_adql_resource_by_ident("http://gillian:8080/firethorn/adql/resource/39559")
    2.67 +
    2.68 +
    2.69 +#
    2.70 +# Create and run a query on the resource.
    2.71 +
    2.72 +
    2.73 +
    2.74 +
    2.75 +## Test 1: Test a query with an TINYINT column (filterID from table Filter)
    2.76 +## ---------------------------------------------------------------------------------------
    2.77 +
    2.78 +
    2.79 +
    2.80 +query_str = "SELECT TOP 10 * FROM ATLASDR1.Filter"
    2.81 +
    2.82 +query_obj = resource.create_query(
    2.83 +    query_str,
    2.84 +    "COMPLETED",
    2.85 +    None,
    2.86 +    3000000
    2.87 +    )
    2.88 +
    2.89 +
    2.90 +print(
    2.91 +    query_obj.table()
    2.92 +     )
    2.93 +{
    2.94 +  "resource": "http://gillian:8080/firethorn/adql/resource/16805",
    2.95 +  "self": "http://gillian:8080/firethorn/adql/table/116821",
    2.96 +  "formats": {
    2.97 +    "datatable": "http://gillian:8080/firethorn/adql/table/116821/datatable",
    2.98 +    "votable": "http://gillian:8080/firethorn/adql/table/116821/votable"
    2.99 +  },
   2.100 +  "url": "http://gillian:8080/firethorn/adql/table/116821",
   2.101 +  "name": "XX_7IKMCQXBBFRYCAAAAFYNAO2FGQ",
   2.102 +  "text": null,
   2.103 +  "query": "http://gillian:8080/firethorn/blue/query/39456",
   2.104 +  "depth": "PARTIAL",
   2.105 +  "metadata": {
   2.106 +    "adql": {
   2.107 +      "status": "COMPLETED",
   2.108 +      "count": 10
   2.109 +    }
   2.110 +  },
   2.111 +  "fullname": "temp.XX_7IKMCQXBBFRYCAAAAFYNAO2FGQ",
   2.112 +  "columns": "http://gillian:8080/firethorn/adql/table/116821/columns/select",
   2.113 +  "schema": "http://gillian:8080/firethorn/adql/schema/35957",
   2.114 +  "type": "http://data.metagrid.co.uk/wfau/firethorn/types/entity/adql-table-1.0.json",
   2.115 +  "owner": "http://gillian:8080/firethorn/community-member/153",
   2.116 +  "root": "http://gillian:8080/firethorn/jdbc/table/116820",
   2.117 +  "ident": "116821",
   2.118 +  "created": "2020-03-12T19:31:50.196",
   2.119 +  "modified": "2020-03-12T19:31:50.197",
   2.120 +  "base": "http://gillian:8080/firethorn/jdbc/table/116820",
   2.121 +  "parent": "http://gillian:8080/firethorn/adql/schema/35957"
   2.122 +}
   2.123 +
   2.124 +
   2.125 +py_table = query_obj.table().as_astropy()
   2.126 +Downloading http://gillian:8080/firethorn/adql/table/116821/votable
   2.127 +|=======================================================================================================================================================================| 5.0k/5.0k (100.00%)         0s
   2.128 +>>> 
   2.129 +KeyboardInterrupt
   2.130 +>>> py_table.pprint()
   2.131 +filterID shortName      name                                                               description                                                           ...   vegaToAB    oneSecMLVg  isSectioned
   2.132 +-------- --------- -------------- ------------------------------------------------------------------------------------------------------------------------------ ... ------------ ------------ -----------
   2.133 +       0      NONE           NONE                                                                                                                           NONE ... -999999500.0 -999999500.0           0
   2.134 +       1         u         u_SDSS Sloan u filter: see  Tokunaga et al., 2002, PASP, 114, 180; http://www.astro-wise.org/~omegacam/documents/3110_user_manual.pdf ...         0.94 -999999500.0           0
   2.135 +       2         g         g_SDSS Sloan g filter: see  Tokunaga et al., 2002, PASP, 114, 180; http://www.astro-wise.org/~omegacam/documents/3110_user_manual.pdf ...        -0.08 -999999500.0           0
   2.136 +       3         r         r_SDSS Sloan r filter (see Tokunaga et al., 2002, PASP, 114, 180; http://www.astro-wise.org/~omegacam/documents/3110_user_manual.pdf) ...         0.17 -999999500.0           0
   2.137 +       4         i         i_SDSS Sloan i filter (see Tokunaga et al., 2002, PASP, 114, 180; http://www.astro-wise.org/~omegacam/documents/3110_user_manual.pdf) ...          0.4 -999999500.0           0
   2.138 +       5         z         z_SDSS Sloan z filter (see Tokunaga et al., 2002, PASP, 114, 180; http://www.astro-wise.org/~omegacam/documents/3110_user_manual.pdf) ...         0.57 -999999500.0           0
   2.139 +       6         B         B_JOHN                                                                                                               Johnson B filter ...       -0.044 -999999500.0           0
   2.140 +       7         V         V_JOHN                                                                                                               Johnson V filter ...       -0.163 -999999500.0           0
   2.141 +       8      BLNK OMEGACAM blank                                                                                         OMEGACAM blank filter (e.g. for darks) ... -999999500.0 -999999500.0           0
   2.142 +       9     vStrm         v_STRM    
   2.143 +
   2.144 +
   2.145 +## Check VOTable file
   2.146 +
   2.147 +import requests
   2.148 +r = requests.get("http://gillian:8080/firethorn/adql/table/116821/votable")
   2.149 +r.text
   2.150 +
   2.151 +## Pretty print
   2.152 +"
   2.153 +<?xml version="1.0" encoding="UTF-8"?>
   2.154 +<VOTABLE xmlns="http://www.ivoa.net/xml/VOTable/v1.3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ivoa.net/xml/VOTable/v1.3 http://www.ivoa.net/xml/VOTable/v1.3" version="1.3">
   2.155 +  <RESOURCE type="results">
   2.156 +    <INFO name="QUERY_STATUS" value="OK"/>
   2.157 +    <INFO name="link" value="http://gillian:8080/firethorn/adql/table/116821"/>
   2.158 +    <TABLE ID="table.116821" name="XX_7IKMCQXBBFRYCAAAAFYNAO2FGQ">
   2.159 +      <FIELD ID="column.120368" name="filterID" datatype="unsignedByte">
   2.160 +        <LINK content-type="application/json" content-role="metadata" href="http://gillian:8080/firethorn/adql/column/120368"/>
   2.161 +      </FIELD>
   2.162 +      <FIELD ID="column.120370" name="shortName" datatype="char" arraysize="10">
   2.163 +        <LINK content-type="application/json" content-role="metadata" href="http://gillian:8080/firethorn/adql/column/120370"/>
   2.164 +      </FIELD>
   2.165 +      <FIELD ID="column.120372" name="name" datatype="char" arraysize="16">
   2.166 +        <LINK content-type="application/json" content-role="metadata" href="http://gillian:8080/firethorn/adql/column/120372"/>
   2.167 +      </FIELD>
   2.168 +      <FIELD ID="column.120374" name="description" datatype="char" arraysize="256">
   2.169 +        <LINK content-type="application/json" content-role="metadata" href="http://gillian:8080/firethorn/adql/column/120374"/>
   2.170 +      </FIELD>
   2.171 +      <FIELD ID="column.120376" name="cutOn" datatype="float">
   2.172 +        <LINK content-type="application/json" content-role="metadata" href="http://gillian:8080/firethorn/adql/column/120376"/>
   2.173 +      </FIELD>
   2.174 +      <FIELD ID="column.120378" name="cutOff" datatype="float">
   2.175 +        <LINK content-type="application/json" content-role="metadata" href="http://gillian:8080/firethorn/adql/column/120378"/>
   2.176 +      </FIELD>
   2.177 +      <FIELD ID="column.120380" name="aebv" datatype="float">
   2.178 +        <LINK content-type="application/json" content-role="metadata" href="http://gillian:8080/firethorn/adql/column/120380"/>
   2.179 +      </FIELD>
   2.180 +      <FIELD ID="column.120382" name="vegaToAB" datatype="float">
   2.181 +        <LINK content-type="application/json" content-role="metadata" href="http://gillian:8080/firethorn/adql/column/120382"/>
   2.182 +      </FIELD>
   2.183 +      <FIELD ID="column.120384" name="oneSecMLVg" datatype="float">
   2.184 +        <LINK content-type="application/json" content-role="metadata" href="http://gillian:8080/firethorn/adql/column/120384"/>
   2.185 +      </FIELD>
   2.186 +      <FIELD ID="column.120386" name="isSectioned" datatype="unsignedByte">
   2.187 +        <LINK content-type="application/json" content-role="metadata" href="http://gillian:8080/firethorn/adql/column/120386"/>
   2.188 +      </FIELD>
   2.189 +      <DATA>
   2.190 +        <TABLEDATA>
   2.191 +          <TR>
   2.192 +            <TD>0</TD>
   2.193 +            <TD>NONE</TD>
   2.194 +            <TD>NONE</TD>
   2.195 +            <TD>NONE</TD>
   2.196 +            <TD>-9.99999488E8</TD>
   2.197 +            <TD>-9.99999488E8</TD>
   2.198 +            <TD>-9.99999488E8</TD>
   2.199 +            <TD>-9.99999488E8</TD>
   2.200 +            <TD>-9.99999488E8</TD>
   2.201 +            <TD>0</TD>
   2.202 +          </TR>
   2.203 +          <TR>
   2.204 +            <TD>1</TD>
   2.205 +            <TD>u</TD>
   2.206 +            <TD>u_SDSS</TD>
   2.207 +            <TD>Sloan u filter: see  Tokunaga et al., 2002, PASP, 114, 180; http://www.astro-wise.org/~omegacam/documents/3110_user_manual.pdf</TD>
   2.208 +            <TD>0.32690000534057617</TD>
   2.209 +            <TD>0.3828999996185303</TD>
   2.210 +            <TD>5.15500020980835</TD>
   2.211 +            <TD>0.9399999976158142</TD>
   2.212 +            <TD>-9.99999488E8</TD>
   2.213 +            <TD>0</TD>
   2.214 +          </TR>
   2.215 +          <TR>
   2.216 +            <TD>2</TD>
   2.217 +            <TD>g</TD>
   2.218 +            <TD>g_SDSS</TD>
   2.219 +            <TD>Sloan g filter: see  Tokunaga et al., 2002, PASP, 114, 180; http://www.astro-wise.org/~omegacam/documents/3110_user_manual.pdf</TD>
   2.220 +            <TD>0.4092000126838684</TD>
   2.221 +            <TD>0.5457000136375427</TD>
   2.222 +            <TD>3.7929999828338623</TD>
   2.223 +            <TD>-0.07999999821186066</TD>
   2.224 +            <TD>-9.99999488E8</TD>
   2.225 +            <TD>0</TD>
   2.226 +          </TR>
   2.227 +          <TR>
   2.228 +            <TD>3</TD>
   2.229 +            <TD>r</TD>
   2.230 +            <TD>r_SDSS</TD>
   2.231 +            <TD>Sloan r filter (see Tokunaga et al., 2002, PASP, 114, 180; http://www.astro-wise.org/~omegacam/documents/3110_user_manual.pdf)</TD>
   2.232 +            <TD>0.5546000003814697</TD>
   2.233 +            <TD>0.6916999816894531</TD>
   2.234 +            <TD>2.750999927520752</TD>
   2.235 +            <TD>0.17000000178813934</TD>
   2.236 +            <TD>-9.99999488E8</TD>
   2.237 +            <TD>0</TD>
   2.238 +          </TR>
   2.239 +          <TR>
   2.240 +            <TD>4</TD>
   2.241 +            <TD>i</TD>
   2.242 +            <TD>i_SDSS</TD>
   2.243 +            <TD>Sloan i filter (see Tokunaga et al., 2002, PASP, 114, 180; http://www.astro-wise.org/~omegacam/documents/3110_user_manual.pdf)</TD>
   2.244 +            <TD>0.6949999928474426</TD>
   2.245 +            <TD>0.8309999704360962</TD>
   2.246 +            <TD>2.0859999656677246</TD>
   2.247 +            <TD>0.4000000059604645</TD>
   2.248 +            <TD>-9.99999488E8</TD>
   2.249 +            <TD>0</TD>
   2.250 +          </TR>
   2.251 +          <TR>
   2.252 +            <TD>5</TD>
   2.253 +            <TD>z</TD>
   2.254 +            <TD>z_SDSS</TD>
   2.255 +            <TD>Sloan z filter (see Tokunaga et al., 2002, PASP, 114, 180; http://www.astro-wise.org/~omegacam/documents/3110_user_manual.pdf)</TD>
   2.256 +            <TD>0.8654999732971191</TD>
   2.257 +            <TD>0.9605000019073486</TD>
   2.258 +            <TD>1.4789999723434448</TD>
   2.259 +            <TD>0.5699999928474426</TD>
   2.260 +            <TD>-9.99999488E8</TD>
   2.261 +            <TD>0</TD>
   2.262 +          </TR>
   2.263 +          <TR>
   2.264 +            <TD>6</TD>
   2.265 +            <TD>B</TD>
   2.266 +            <TD>B_JOHN</TD>
   2.267 +            <TD>Johnson B filter</TD>
   2.268 +            <TD>0.38999998569488525</TD>
   2.269 +            <TD>0.49000000953674316</TD>
   2.270 +            <TD>-9.99999488E8</TD>
   2.271 +            <TD>-0.04399999976158142</TD>
   2.272 +            <TD>-9.99999488E8</TD>
   2.273 +            <TD>0</TD>
   2.274 +          </TR>
   2.275 +          <TR>
   2.276 +            <TD>7</TD>
   2.277 +            <TD>V</TD>
   2.278 +            <TD>V_JOHN</TD>
   2.279 +            <TD>Johnson V filter</TD>
   2.280 +            <TD>0.5</TD>
   2.281 +            <TD>0.6000000238418579</TD>
   2.282 +            <TD>-9.99999488E8</TD>
   2.283 +            <TD>-0.16300000250339508</TD>
   2.284 +            <TD>-9.99999488E8</TD>
   2.285 +            <TD>0</TD>
   2.286 +          </TR>
   2.287 +          <TR>
   2.288 +            <TD>8</TD>
   2.289 +            <TD>BLNK</TD>
   2.290 +            <TD>OMEGACAM blank</TD>
   2.291 +            <TD>OMEGACAM blank filter (e.g. for darks)</TD>
   2.292 +            <TD>-9.99999488E8</TD>
   2.293 +            <TD>-9.99999488E8</TD>
   2.294 +            <TD>-9.99999488E8</TD>
   2.295 +            <TD>-9.99999488E8</TD>
   2.296 +            <TD>-9.99999488E8</TD>
   2.297 +            <TD>0</TD>
   2.298 +          </TR>
   2.299 +          <TR>
   2.300 +            <TD>9</TD>
   2.301 +            <TD>vStrm</TD>
   2.302 +            <TD>v_STRM</TD>
   2.303 +            <TD>Stroemgren v</TD>
   2.304 +            <TD>0.40049999952316284</TD>
   2.305 +            <TD>0.42149999737739563</TD>
   2.306 +            <TD>-9.99999488E8</TD>
   2.307 +            <TD>-9.99999488E8</TD>
   2.308 +            <TD>-9.99999488E8</TD>
   2.309 +            <TD>0</TD>
   2.310 +          </TR>
   2.311 +        </TABLEDATA>
   2.312 +      </DATA>
   2.313 +    </TABLE>
   2.314 +  </RESOURCE>
   2.315 +</VOTABLE>"
   2.316 +
   2.317 +
   2.318 +# filterID -> unsignedByte
   2.319 +## <FIELD ID='column.39725' name='filterID' datatype='unsignedByte'>
   2.320 +## filterID values look correct (TINYINT to unsignedByte without an arraysize) 
   2.321 +
   2.322 +
   2.323 +
   2.324 +
   2.325 +## Test 2: Test column of type BYTE (array)
   2.326 +## ---------------------------------------------------------------------------------------
   2.327 +
   2.328 +
   2.329 +## Test with a TAP sync query:
   2.330 +
   2.331 +curl -L "http://localhost:8080/firethorn/tap/39559/sync?QUERY=SELECT+TOP+5+*+FROM+BestDR9.Sky&REQUEST=doQuery&LANG=ADQL&FORMAT=VOTABLE"
   2.332 +<?xml version="1.0" encoding="UTF-8"?>
   2.333 +<VOTABLE xmlns="http://www.ivoa.net/xml/VOTable/v1.3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ivoa.net/xml/VOTable/v1.3 http://www.ivoa.net/xml/VOTable/v1.3" version="1.3">
   2.334 +  <RESOURCE type="results">
   2.335 +    <INFO name="QUERY_STATUS" value="OK"/>
   2.336 +    <INFO name="link" value="http://localhost:8080/firethorn/adql/table/116823"/>
   2.337 +    <TABLE ID="table.116823" name="XX_UQYJEFY2CKCZIAAAAFYNAQE7VU">
   2.338 +      <FIELD ID="column.120388" name="img" datatype="unsignedByte" arraysize="8000">
   2.339 +        <LINK content-type="application/json" content-role="metadata" href="http://localhost:8080/firethorn/adql/column/120388"/>
   2.340 +      </FIELD>
   2.341 +      <DATA>
   2.342 +        <TABLEDATA>
   2.343 +          <TR>
   2.344 +            <TD>137 80 78 71 13 10 26 10 0 0 0 13 73 72 68 82 0 0 4 110 0 0 3 42 8 3 0 0 0 228 125 247 172 0 0 1 128 80 76 84 69 0 0 0 11 11 11 18 18 18 27 27 27 33 33 33 41 41 41 52 52 52 54 54 56 58 58 58 67 67 67 73 73 73 82 82 82 92 92 92 100 100 100 106 106 106 118 118 118 121 121 121 1 0 138 0 0 186 40 40 226 54 54 240 59 59 245 62 62 248 67 67 253 101 101 235 109 109 243 113 113 247 118 117 253 118 120 255 120 119 255 121 120 255 253 68 67 254 118 118 255 120 120 132 132 132 136 136 136 147 147 147 154 154 154 164 164 164 171 171 171 177 177 177 187 187 187 147 147 212 159 159 209 157 156 222 13
   2.345 +
   2.346 +               .....
   2.347 +
   2.348 +            </TD>
   2.349 +          </TR>
   2.350 +        </TABLEDATA>
   2.351 +      </DATA>
   2.352 +    </TABLE>
   2.353 +  </RESOURCE>
   2.354 +</VOTABLE>
   2.355 +
   2.356 +
   2.357 +## VALID
   2.358 +## Column printed as Space-delimited byte array
   2.359 +## img -> unsignedByte
   2.360 +## Column Type in VOTable: name='img' datatype='unsignedByte' arraysize='8000'
   2.361 +
   2.362 +
   2.363 +
   2.364 +
   2.365 +
   2.366 +
   2.367 +
   2.368 +## Test3: Validate with Taplint
   2.369 +## ---------------------------------------------------------------------------------------
   2.370 +
   2.371 +java -jar stilts.jar taplint tapurl=http://localhost:8080/firethorn/tap/39559/  debug=true
   2.372 +
   2.373 +java -jar stilts.jar taplint tapurl=http://localhost:8080/firethorn/tap/39559/  debug=true
   2.374 +This is STILTS taplint, 3.2/1c07f08 (2019-11-18)
   2.375 +Static report types: ERROR(139), WARNING(56), INFO(23), SUMMARY(9), FAILURE(22)
   2.376 +
   2.377 +Section TMV: Validate table metadata against XML schema
   2.378 +I-TMV-VURL-1 Validating http://localhost:8080/firethorn/tap/39559/tables as tableset (http://www.ivoa.net/xml/VODataService/v1.1)
   2.379 +S-TMV-VALI-1 SAX report: warnings 0, errors 0, fatal 0
   2.380 +
   2.381 +Section TME: Check content of tables metadata from /tables
   2.382 +I-TME-CURL-1 Reading capability metadata from http://localhost:8080/firethorn/tap/39559/capabilities
   2.383 +I-TME-TURL-1 Reading table metadata from http://localhost:8080/firethorn/tap/39559/tables
   2.384 +S-TME-SUMM-1 Schemas: 14, Tables: 471, Columns: 18854, Foreign Keys: 0
   2.385 +S-TME-FLGS-1 Standard column flags: indexed: 0, primary: 0, nullable: 0
   2.386 +S-TME-FLGO-1 Other column flags: none
   2.387 +
   2.388 +Section TMS: Check content of tables metadata from TAP_SCHEMA
   2.389 +I-TMS-TAPV-1 Validating for TAP version V1.0
   2.390 +I-TMS-QSUB-1 Submitting query: SELECT COUNT(*) AS nr FROM TAP_SCHEMA.schemas
   2.391 +I-TMS-QGET-1 Query GET URL: http://localhost:8080/firethorn/tap/39559/sync?REQUEST=doQuery&LANG=ADQL&QUERY=SELECT+COUNT%28*%29+AS+nr+FROM+TAP_SCHEMA.schemas
   2.392 +I-TMS-QSUB-2 Submitting query: SELECT COUNT(*) AS nr FROM TAP_SCHEMA.tables
   2.393 +I-TMS-QGET-2 Query GET URL: http://localhost:8080/firethorn/tap/39559/sync?REQUEST=doQuery&LANG=ADQL&QUERY=SELECT+COUNT%28*%29+AS+nr+FROM+TAP_SCHEMA.tables
   2.394 +I-TMS-QSUB-3 Submitting query: SELECT COUNT(*) AS nr FROM TAP_SCHEMA.columns
   2.395 +I-TMS-QGET-3 Query GET URL: http://localhost:8080/firethorn/tap/39559/sync?REQUEST=doQuery&LANG=ADQL&QUERY=SELECT+COUNT%28*%29+AS+nr+FROM+TAP_SCHEMA.columns
   2.396 +I-TMS-QSUB-4 Submitting query: SELECT COUNT(*) AS nr FROM TAP_SCHEMA.keys
   2.397 +I-TMS-QGET-4 Query GET URL: http://localhost:8080/firethorn/tap/39559/sync?REQUEST=doQuery&LANG=ADQL&QUERY=SELECT+COUNT%28*%29+AS+nr+FROM+TAP_SCHEMA.keys
   2.398 +I-TMS-QSUB-5 Submitting query: SELECT COUNT(*) AS nr FROM TAP_SCHEMA.key_columns
   2.399 +I-TMS-QGET-5 Query GET URL: http://localhost:8080/firethorn/tap/39559/sync?REQUEST=doQuery&LANG=ADQL&QUERY=SELECT+COUNT%28*%29+AS+nr+FROM+TAP_SCHEMA.key_columns
   2.400 +I-TMS-QSUB-6 Submitting query: SELECT principal, indexed, std, "size" FROM TAP_SCHEMA.columns
   2.401 +I-TMS-QGET-6 Query GET URL: http://localhost:8080/firethorn/tap/39559/sync?REQUEST=doQuery&LANG=ADQL&QUERY=SELECT+principal%2C+indexed%2C+std%2C+%22size%22+FROM+TAP_SCHEMA.columns&MAXREC=18864
   2.402 +I-TMS-QSUB-7 Submitting query: SELECT TOP 1 * FROM TAP_SCHEMA.columns
   2.403 +I-TMS-QGET-7 Query GET URL: http://localhost:8080/firethorn/tap/39559/sync?REQUEST=doQuery&LANG=ADQL&QUERY=SELECT+TOP+1+*+FROM+TAP_SCHEMA.columns&MAXREC=1
   2.404 +I-TMS-QSUB-8 Submitting query: SELECT ts_column_id, table_name, column_name, description, unit, ucd, utype, datatype, arraysize, principal, indexed, std, ft_column_id FROM TAP_SCHEMA.columns
   2.405 +I-TMS-QGET-8 Query GET URL: http://localhost:8080/firethorn/tap/39559/sync?REQUEST=doQuery&LANG=ADQL&QUERY=SELECT+ts_column_id%2C+table_name%2C+column_name%2C+description%2C+unit%2C+ucd%2C+utype%2C+datatype%2C+arraysize%2C+principal%2C+indexed%2C+std%2C+ft_column_id+FROM+TAP_SCHEMA.columns&MAXREC=18864
   2.406 +I-TMS-QSUB-9 Submitting query: SELECT from_column, target_column, key_id FROM TAP_SCHEMA.key_columns
   2.407 +I-TMS-QGET-9 Query GET URL: http://localhost:8080/firethorn/tap/39559/sync?REQUEST=doQuery&LANG=ADQL&QUERY=SELECT+from_column%2C+target_column%2C+key_id+FROM+TAP_SCHEMA.key_columns&MAXREC=18864
   2.408 +E-TMS-TSCT-1 Type mismatch for column TAP_SCHEMA.schemas.schema_name: datatype=char is not varchar-like (TAP 1.0)
   2.409 +E-TMS-TSCT-2 Type mismatch for column TAP_SCHEMA.schemas.utype: datatype=char is not varchar-like (TAP 1.0)
   2.410 +E-TMS-TSCT-3 Type mismatch for column TAP_SCHEMA.schemas.description: datatype=char is not varchar-like (TAP 1.0)
   2.411 +I-TMS-TSNS-1 2 non-standard columns in TAP_SCHEMA.schemas: [ts_schema_id, ft_schema_id]
   2.412 +E-TMS-TSCT-4 Type mismatch for column TAP_SCHEMA.tables.schema_name: datatype=char is not varchar-like (TAP 1.0)
   2.413 +E-TMS-TSCT-5 Type mismatch for column TAP_SCHEMA.tables.table_name: datatype=char is not varchar-like (TAP 1.0)
   2.414 +E-TMS-TSCT-6 Type mismatch for column TAP_SCHEMA.tables.table_type: datatype=char is not varchar-like (TAP 1.0)
   2.415 +E-TMS-TSCT-7 Type mismatch for column TAP_SCHEMA.tables.utype: datatype=char is not varchar-like (TAP 1.0)
   2.416 +E-TMS-TSCT-8 Type mismatch for column TAP_SCHEMA.tables.description: datatype=char is not varchar-like (TAP 1.0)
   2.417 +I-TMS-TSNS-2 2 non-standard columns in TAP_SCHEMA.tables: [ts_table_id, ft_table_id]
   2.418 +E-TMS-TSCT-9 Type mismatch for column TAP_SCHEMA.columns.table_name: datatype=char is not varchar-like (TAP 1.0)
   2.419 +I-TMS-TSNS-3 3 non-standard columns in TAP_SCHEMA.columns: [arraysize, ts_column_id, ft_column_id]
   2.420 +I-TMS-TSNS-4 1 non-standard columns in TAP_SCHEMA.keys: [ts_key_id]
   2.421 +I-TMS-TSNS-5 1 non-standard columns in TAP_SCHEMA.key_columns: [ts_key_column_id]
   2.422 +S-TMS-SUMM-1 Schemas: 14, Tables: 471, Columns: 18854, Foreign Keys: 0
   2.423 +S-TMS-FLGS-1 Standard column flags: indexed: 0, principal: 7, std: 33
   2.424 +S-TMS-QNUM-1 Successful/submitted TAP queries: 29/29
   2.425 +S-TMS-QTIM-1 Average successful query time: 1.5s
   2.426 +I-TMS-QSUB-x (20 more)
   2.427 +I-TMS-QGET-x (20 more)
   2.428 +E-TMS-TSCT-x (18 more)
   2.429 +
   2.430 +Section TMC: Compare table metadata from /tables and TAP_SCHEMA
   2.431 +
   2.432 +Section CPV: Validate capabilities against XML schema
   2.433 +I-CPV-VURL-1 Validating http://localhost:8080/firethorn/tap/39559/capabilities as capabilities (http://www.ivoa.net/xml/VOSICapabilities/v1.0)
   2.434 +S-CPV-VALI-1 SAX report: warnings 0, errors 0, fatal 0
   2.435 +
   2.436 +Section CAP: Check TAP and TAPRegExt content of capabilities document
   2.437 +
   2.438 +Section AVV: Validate availability against XML schema
   2.439 +I-AVV-VURL-1 Validating http://localhost:8080/firethorn/tap/39559/availability as availability (http://www.ivoa.net/xml/VOSIAvailability/v1.0)
   2.440 +S-AVV-VALI-1 SAX report: warnings 0, errors 0, fatal 0
   2.441 +
   2.442 +Section QGE: Make ADQL queries in sync GET mode
   2.443 +I-QGE-QSUB-1 Submitting query: SELECT TOP 10 surveyID FROM VHSDR1.Survey
   2.444 +I-QGE-QGET-1 Query GET URL: http://localhost:8080/firethorn/tap/39559/sync?REQUEST=doQuery&LANG=ADQL&QUERY=SELECT+TOP+10+surveyID+FROM+VHSDR1.Survey
   2.445 +I-QGE-QSUB-2 Submitting query: SELECT surveyID FROM VHSDR1.Survey
   2.446 +I-QGE-QGET-2 Query GET URL: http://localhost:8080/firethorn/tap/39559/sync?REQUEST=doQuery&LANG=ADQL&QUERY=SELECT+surveyID+FROM+VHSDR1.Survey&MAXREC=0
   2.447 +I-QGE-QSUB-3 Submitting query: SELECT TOP 10 surveyID FROM VHSDR1.Survey
   2.448 +I-QGE-QGET-3 Query GET URL: http://localhost:8080/firethorn/tap/39559/sync?REQUEST=doQuery&LANG=ADQL&QUERY=SELECT+TOP+10+surveyID+FROM+VHSDR1.Survey&DUMMY=ignore-me
   2.449 +I-QGE-QSUB-4 Submitting query: SELECT TOP 1 surveyID FROM VHSDR1.Survey
   2.450 +I-QGE-QGET-4 Query GET URL: http://localhost:8080/firethorn/tap/39559/sync?REQUEST=doQuery&LANG=ADQL-2.0&QUERY=SELECT+TOP+1+surveyID+FROM+VHSDR1.Survey
   2.451 +I-QGE-QSUB-5 Submitting query: SELECT TOP 1 surveyID FROM VHSDR1.Survey
   2.452 +I-QGE-QGET-5 Query GET URL: http://localhost:8080/firethorn/tap/39559/sync?REQUEST=doQuery&LANG=ADQL&QUERY=SELECT+TOP+1+surveyID+FROM+VHSDR1.Survey
   2.453 +I-QGE-QSUB-6 Submitting query: SELECT TOP 8 sdssPrimary, sdssType AS taplint_c_2, V.distanceMins, slaveObjID AS taplint_c_4, masterObjID FROM VHSDR1.vhsSourceXDR7PhotoObj AS V
   2.454 +I-QGE-QGET-6 Query GET URL: http://localhost:8080/firethorn/tap/39559/sync?REQUEST=doQuery&LANG=ADQL&QUERY=SELECT+TOP+8+sdssPrimary%2C+sdssType+AS+taplint_c_2%2C+V.distanceMins%2C+slaveObjID+AS+taplint_c_4%2C+masterObjID++FROM+VHSDR1.vhsSourceXDR7PhotoObj+AS+V
   2.455 +I-QGE-QSUB-7 Submitting query: SELECT masterObjID FROM VHSDR1.vhsSourceXDR7PhotoObjAll
   2.456 +I-QGE-QGET-7 Query GET URL: http://localhost:8080/firethorn/tap/39559/sync?REQUEST=doQuery&LANG=ADQL&QUERY=SELECT+masterObjID+FROM+VHSDR1.vhsSourceXDR7PhotoObjAll&MAXREC=0
   2.457 +I-QGE-DUFF-1 Submitting query expected to fail (bad ADQL): DUFF QUERY
   2.458 +I-QGE-QGET-8 Query GET URL: http://localhost:8080/firethorn/tap/39559/sync?REQUEST=doQuery&LANG=ADQL&QUERY=DUFF+QUERY
   2.459 +I-QGE-DUFF-2 Submitting query expected to fail (unknown query language): SELECT TOP 1 * FROM TAP_SCHEMA.tables
   2.460 +I-QGE-QGET-9 Query GET URL: http://localhost:8080/firethorn/tap/39559/sync?REQUEST=doQuery&LANG=OOBLECK&QUERY=SELECT+TOP+1+*+FROM+TAP_SCHEMA.tables
   2.461 +S-QGE-QNUM-1 Successful/submitted TAP queries: 7/7
   2.462 +S-QGE-QTIM-1 Average successful query time: 1.1s
   2.463 +
   2.464 +Section QPO: Make ADQL queries in sync POST mode
   2.465 +I-QPO-QSUB-1 Submitting query: SELECT TOP 10 surveyID FROM VHSDR1.Survey
   2.466 +I-QPO-QSUB-2 Submitting query: SELECT surveyID FROM VHSDR1.Survey
   2.467 +I-QPO-QSUB-3 Submitting query: SELECT TOP 10 surveyID FROM VHSDR1.Survey
   2.468 +I-QPO-QSUB-4 Submitting query: SELECT TOP 8 sdssPrimary, sdssType AS taplint_c_2, V.distanceMins, slaveObjID AS taplint_c_4, masterObjID FROM VHSDR1.vhsSourceXDR7PhotoObj AS V
   2.469 +I-QPO-QSUB-5 Submitting query: SELECT masterObjID FROM VHSDR1.vhsSourceXDR7PhotoObjAll
   2.470 +I-QPO-DUFF-1 Submitting query expected to fail (bad ADQL): DUFF QUERY
   2.471 +I-QPO-DUFF-2 Submitting query expected to fail (unknown query language): SELECT TOP 1 * FROM TAP_SCHEMA.tables
   2.472 +S-QPO-QNUM-1 Successful/submitted TAP queries: 5/5
   2.473 +S-QPO-QTIM-1 Average successful query time: 1.1s
   2.474 +
   2.475 +Section QAS: Make ADQL queries in async mode
   2.476 +I-QAS-QSUB-1 Submitting query: SELECT TOP 10 surveyID FROM VHSDR1.Survey
   2.477 +I-QAS-QJOB-1 Submitted query at http://localhost:8080/firethorn/tap/39559/async/121242
   2.478 +I-QAS-QSUB-2 Submitting query: SELECT surveyID FROM VHSDR1.Survey
   2.479 +I-QAS-QJOB-2 Submitted query at http://localhost:8080/firethorn/tap/39559/async/121243
   2.480 +I-QAS-QSUB-3 Submitting query: SELECT TOP 10 surveyID FROM VHSDR1.Survey
   2.481 +I-QAS-QJOB-3 Submitted query at http://localhost:8080/firethorn/tap/39559/async/121244
   2.482 +I-QAS-QSUB-4 Submitting query: SELECT TOP 8 sdssPrimary, sdssType AS taplint_c_2, V.distanceMins, slaveObjID AS taplint_c_4, masterObjID FROM VHSDR1.vhsSourceXDR7PhotoObj AS V
   2.483 +I-QAS-QJOB-4 Submitted query at http://localhost:8080/firethorn/tap/39559/async/121245
   2.484 +I-QAS-QSUB-5 Submitting query: SELECT masterObjID FROM VHSDR1.vhsSourceXDR7PhotoObjAll
   2.485 +I-QAS-QJOB-5 Submitted query at http://localhost:8080/firethorn/tap/39559/async/121246
   2.486 +I-QAS-DUFF-1 Submitting query expected to fail (bad ADQL): DUFF QUERY
   2.487 +I-QAS-QJOB-6 Submitted query at http://localhost:8080/firethorn/tap/39559/async/121247
   2.488 +I-QAS-DUFF-2 Submitting query expected to fail (unknown query language): SELECT TOP 1 * FROM TAP_SCHEMA.tables
   2.489 +I-QAS-QJOB-7 Submitted query at http://localhost:8080/firethorn/tap/39559/async/121248
   2.490 +E-QAS-DSUC-1 Apparent success from bad query (unknown query language)
   2.491 +S-QAS-QNUM-1 Successful/submitted TAP queries: 5/5
   2.492 +S-QAS-QTIM-1 Average successful query time: 1.6s
   2.493 +
   2.494 +Section UWS: Test asynchronous UWS/TAP behaviour
   2.495 +I-UWS-CJOB-1 Created new job http://localhost:8080/firethorn/tap/39559/async/121249
   2.496 +I-UWS-POPA-1 POSTed runId=TAPLINT-002 to http://localhost:8080/firethorn/tap/39559/async/121249/parameters
   2.497 +I-UWS-POPA-2 POSTed PHASE=ABORT to http://localhost:8080/firethorn/tap/39559/async/121249/phase
   2.498 +I-UWS-POPA-3 POSTed ACTION=DELETE to http://localhost:8080/firethorn/tap/39559/async/121249
   2.499 +I-UWS-CJOB-2 Created new job http://localhost:8080/firethorn/tap/39559/async/121250
   2.500 +I-UWS-CJOB-3 Created new job http://localhost:8080/firethorn/tap/39559/async/121251
   2.501 +I-UWS-VUWS-1 UWS job document implicitly V1.0
   2.502 +I-UWS-POPA-4 POSTed PHASE=RUN to http://localhost:8080/firethorn/tap/39559/async/121251/phase
   2.503 +
   2.504 +Section MDQ: Check table query result columns against declared metadata
   2.505 +I-MDQ-QSUB-1 Submitting query: SELECT TOP 1 * FROM "FIRST".first08Jul16Source
   2.506 +I-MDQ-QSUB-2 Submitting query: SELECT TOP 1 * FROM "FIRST".firstSource
   2.507 +I-MDQ-QSUB-3 Submitting query: SELECT TOP 1 * FROM "FIRST".firstSource12Feb16
   2.508 +I-MDQ-QSUB-4 Submitting query: SELECT TOP 1 * FROM ATLASDR1.ArchiveCurationHistory
   2.509 +I-MDQ-QSUB-5 Submitting query: SELECT TOP 1 * FROM ATLASDR1.AstrCalVers
   2.510 +I-MDQ-QSUB-6 Submitting query: SELECT TOP 1 * FROM ATLASDR1.CurationTask
   2.511 +I-MDQ-QSUB-7 Submitting query: SELECT TOP 1 * FROM ATLASDR1.CurrentAstrometry
   2.512 +I-MDQ-QSUB-8 Submitting query: SELECT TOP 1 * FROM ATLASDR1.ExternalSurvey
   2.513 +I-MDQ-QSUB-9 Submitting query: SELECT TOP 1 * FROM ATLASDR1.ExternalSurveyTable
   2.514 +S-MDQ-QNUM-1 Successful/submitted TAP queries: 471/471
   2.515 +S-MDQ-QTIM-1 Average successful query time: 1.8s
   2.516 +I-MDQ-QSUB-x (462 more)
   2.517 +
   2.518 +Section OBS: Test implementation of ObsCore Data Model
   2.519 +I-OBS-NODM-1 Table capabilities lists no ObsCore DataModel - no ObsCore tests
   2.520 +
   2.521 +Section UPL: Make queries with table uploads
   2.522 +F-UPL-NOUP-1 Table capabilities lists no upload methods - will not attempt upload tests
   2.523 +
   2.524 +Section EXA: Check content of examples document
   2.525 +I-EXA-EURL-1 Reading examples document from http://localhost:8080/firethorn/tap/39559/examples
   2.526 +F-EXA-EXNO-1 No examples document at http://localhost:8080/firethorn/tap/39559/examples
   2.527 +
   2.528 +Totals: Errors: 28; Warnings: 0; Infos: 589; Summaries: 18; Failures: 2
   2.529 +
   2.530 +## Some (unrelated errors), issue for them created in Redmine (http://redmine.roe.ac.uk/issues/1183)
   2.531 +
   2.532 +
   2.533 +
   2.534 +
   2.535 +## Test4: Run our own validator
   2.536 +## ---------------------------------------------------------------------------------------
   2.537 +
   2.538 +
   2.539 +## From ftpy container run:
   2.540 +
   2.541 +python3 -c "import firethorn_utils.tap_validator as validator;validator.main()" -ft=http://gillian:8080/firethorn -r=39559 -u= -p= -g= -m=sync
   2.542 +--- Starting validation on Resource: http://gillian:8080/firethorn/adql/resource/---
   2.543 +...
   2.544 +
   2.545 +## Test completed, but a one exceptions, with time out error messages
   2.546 +
   2.547 +Exceptions: 
   2.548 +{'BestDR9.Sky': '<urlopen error timed out>'}
   2.549 +
   2.550 +## Run queries on those tables to check
   2.551 +curl -L "http://localhost:8080/firethorn/tap/39559/sync?QUERY=SELECT+TOP+5+*+FROM+BestDR9.Sky&REQUEST=doQuery&LANG=ADQL&FORMAT=VOTABLE"
   2.552 +
   2.553 +..
   2.554 + <TABLEDATA></TABLEDATA></DATA></TABLE></RESOURCE></VOTABLE>
   2.555 +..
   2.556 +
   2.557 +
   2.558 +## Query completed, but empty table
   2.559 +
     3.1 --- a/firethorn-core/src/main/java/uk/ac/roe/wfau/firethorn/meta/adql/AdqlColumn.java	Sun Mar 08 11:53:10 2020 +0000
     3.2 +++ b/firethorn-core/src/main/java/uk/ac/roe/wfau/firethorn/meta/adql/AdqlColumn.java	Thu Mar 12 22:28:48 2020 +0200
     3.3 @@ -259,7 +259,7 @@
     3.4                  case TIMESTAMP :
     3.5                      return AdqlColumn.AdqlType.DATETIME;
     3.6                  case TINYINT :
     3.7 -                    return AdqlColumn.AdqlType.SHORT;
     3.8 +                    return AdqlColumn.AdqlType.BYTE;
     3.9  
    3.10  
    3.11                  case BLOB :
     4.1 --- a/firethorn-webapp/src/main/java/uk/ac/roe/wfau/firethorn/webapp/votable/AbstractTableController.java	Sun Mar 08 11:53:10 2020 +0000
     4.2 +++ b/firethorn-webapp/src/main/java/uk/ac/roe/wfau/firethorn/webapp/votable/AbstractTableController.java	Thu Mar 12 22:28:48 2020 +0200
     4.3 @@ -64,7 +64,7 @@
     4.4           *
     4.5           */
     4.6          public String format(final ResultSet results)
     4.7 -        throws SQLException;
     4.8 +        throws SQLException, ProtectionException;
     4.9  
    4.10          /**
    4.11           * The field index in a JDBC ResultSet.
    4.12 @@ -252,7 +252,7 @@
    4.13       *
    4.14       */
    4.15      public void rows(final List<FieldFormatter> formatters, final PrintWriter writer, final ResultSet results)
    4.16 -    throws SQLException
    4.17 +    throws SQLException, ProtectionException
    4.18          {
    4.19          while (results.next())
    4.20              {
    4.21 @@ -269,10 +269,11 @@
    4.22       * @param formatters The {@link List} of {@link FieldFormatter}s to use.
    4.23       * @param writer     The {@link PrintWriter} to write the field to.
    4.24       * @param results    The {@link ResultSet} to get the row from.
    4.25 +     * @throws ProtectionException 
    4.26       *
    4.27       */
    4.28      public abstract void row(final List<FieldFormatter> formatters, final PrintWriter writer, final ResultSet results)
    4.29 -    throws SQLException;
    4.30 +    throws SQLException, ProtectionException;
    4.31  
    4.32      /**
    4.33       * Write all the fields from a {@link ResultSet} to a {@link PrintWriter} using a {@link List} of {@link FieldFormatter}s.
    4.34 @@ -282,7 +283,7 @@
    4.35       *
    4.36       */
    4.37      public void cells(final List<FieldFormatter> formatters, final PrintWriter writer, final ResultSet results)
    4.38 -    throws SQLException
    4.39 +    throws SQLException, ProtectionException
    4.40          {
    4.41          for (final FieldFormatter formatter : formatters)
    4.42              {
    4.43 @@ -299,10 +300,11 @@
    4.44       * @param formatter The {@link FieldFormatter} to use to get the field and format it.
    4.45       * @param writer    The {@link PrintWriter} to write the field to.
    4.46       * @param results   The {@link ResultSet} to get the field from.
    4.47 +     * @throws ProtectionException 
    4.48       *
    4.49       */
    4.50      public abstract void cell(final FieldFormatter formatter, final PrintWriter writer, final ResultSet results)
    4.51 -    throws SQLException;
    4.52 +    throws SQLException, ProtectionException;
    4.53      
    4.54      /**
    4.55       * Write the footer for a {@link BaseTable} to a {@link PrintWriter}.
     5.1 --- a/firethorn-webapp/src/main/java/uk/ac/roe/wfau/firethorn/webapp/votable/BaseTableDataTableController.java	Sun Mar 08 11:53:10 2020 +0000
     5.2 +++ b/firethorn-webapp/src/main/java/uk/ac/roe/wfau/firethorn/webapp/votable/BaseTableDataTableController.java	Thu Mar 12 22:28:48 2020 +0200
     5.3 @@ -194,7 +194,7 @@
     5.4       */
     5.5      @Override
     5.6      public void row(final List<FieldFormatter> formatters, final PrintWriter writer, final ResultSet results)
     5.7 -    throws SQLException
     5.8 +    throws SQLException, ProtectionException
     5.9          {
    5.10          writer.append("{");
    5.11          cells(
    5.12 @@ -212,7 +212,7 @@
    5.13       */
    5.14      @Override
    5.15      public void cells(final List<FieldFormatter> formatters, final PrintWriter writer, final ResultSet results)
    5.16 -    throws SQLException
    5.17 +    throws SQLException, ProtectionException
    5.18          {
    5.19      	int size = 1;
    5.20      	int maxlen = formatters.size();
    5.21 @@ -239,7 +239,7 @@
    5.22       */
    5.23      @Override
    5.24      public void rows(final List<FieldFormatter> formatters, final PrintWriter writer, final ResultSet results)
    5.25 -    throws SQLException
    5.26 +    throws SQLException, ProtectionException
    5.27          {
    5.28          while (results.next())
    5.29              {
    5.30 @@ -261,7 +261,7 @@
    5.31       */
    5.32      @Override
    5.33      public void cell(final FieldFormatter formatter, final PrintWriter writer, final ResultSet results)
    5.34 -    throws SQLException
    5.35 +    throws SQLException, ProtectionException
    5.36          {
    5.37      	  writer.append(
    5.38              formatter.format(
     6.1 --- a/firethorn-webapp/src/main/java/uk/ac/roe/wfau/firethorn/webapp/votable/BaseTableVOTableController.java	Sun Mar 08 11:53:10 2020 +0000
     6.2 +++ b/firethorn-webapp/src/main/java/uk/ac/roe/wfau/firethorn/webapp/votable/BaseTableVOTableController.java	Thu Mar 12 22:28:48 2020 +0200
     6.3 @@ -148,29 +148,27 @@
     6.4  
     6.5          @Override
     6.6          public String format(final ResultSet results)
     6.7 -        throws SQLException
     6.8 +        throws SQLException, ProtectionException
     6.9              {
    6.10                  String byteArrayString = "";
    6.11                  int aux;
    6.12  	            final StringBuilder builder = new StringBuilder(); 
    6.13 -                int size=0;
    6.14                  
    6.15                  if (results.getObject(index())!=null){
    6.16                  	
    6.17 -                    boolean isarray;
    6.18 -
    6.19 -                	try {
    6.20 -                		isarray = column.meta().adql().type().isarray();
    6.21 -                		size =  column.meta().adql().arraysize();
    6.22 -					} catch (ProtectionException e) {
    6.23 -						isarray = false;
    6.24 -					}
    6.25 +                   
    6.26 +            		boolean isarray = column.meta().adql().type().isarray();
    6.27 +            		int size =  column.meta().adql().arraysize();
    6.28 +			
    6.29  
    6.30  					if (!isarray && size<=0) {
    6.31 -					    byte shortval = results.getByte(
    6.32 +						byte[] bytes = results.getBytes(
    6.33  					            index()
    6.34  					        );
    6.35 -					    builder.append(shortval);       
    6.36 +						
    6.37 +						int intval = java.nio.ByteBuffer.wrap(bytes).getInt();
    6.38 +
    6.39 +					    builder.append(intval);       
    6.40  							
    6.41  					} else {
    6.42  					    
    6.43 @@ -332,10 +330,12 @@
    6.44  
    6.45              if (column.meta().adql().arraysize() != null)
    6.46                  {
    6.47 -                if (column.meta().adql().arraysize() == AdqlColumn.NON_ARRAY_SIZE)
    6.48 +            	
    6.49 +            	// Changed AdqlColumn.NON_ARRAY_SIZE and AdqlColumn.VAR_ARRAY_SIZE to 0 and 1, comparison was not working correctly
    6.50 +                if (column.meta().adql().arraysize()==0)
    6.51                      {
    6.52                      }
    6.53 -                else if (column.meta().adql().arraysize() == AdqlColumn.VAR_ARRAY_SIZE || column.meta().adql().arraysize() <= 0)
    6.54 +                else if (column.meta().adql().arraysize()==-1)
    6.55                      {
    6.56                      writer.append(" arraysize='*'");
    6.57                      }
    6.58 @@ -348,9 +348,11 @@
    6.59                  
    6.60              if (column.meta().adql() != null)
    6.61                  {
    6.62 -                writer.append(" xtype='");
    6.63 -                writer.append(column.meta().adql().type().xtype());
    6.64 -                writer.append("'");
    6.65 +                    if (column.meta().adql().type().xtype() != null) {
    6.66 +	                    writer.append(" xtype='");
    6.67 +	                    writer.append(column.meta().adql().type().xtype());
    6.68 +	                    writer.append("'");
    6.69 +	                }
    6.70                  }
    6.71              }
    6.72  
    6.73 @@ -397,7 +399,7 @@
    6.74  
    6.75      @Override
    6.76      public void row(final List<FieldFormatter> formatters, final PrintWriter writer, final ResultSet results)
    6.77 -    throws SQLException
    6.78 +    throws SQLException, ProtectionException
    6.79          {
    6.80          writer.append("<TR>");
    6.81          cells(
    6.82 @@ -410,7 +412,7 @@
    6.83  
    6.84      @Override
    6.85      public void cell(final FieldFormatter formatter, final PrintWriter writer, final ResultSet results)
    6.86 -    throws SQLException
    6.87 +    throws SQLException, ProtectionException
    6.88          {
    6.89      	String content =  formatter.format(results);
    6.90          writer.append("<TD>");