gmantele / vollt

Java libraries implementing the IVOA protocol: ADQL, UWS and TAP
http://cdsportal.u-strasbg.fr/taptuto/
30 stars 29 forks source link

Incomplete automatic TAP_SCHEMA mapping #98

Closed gmantele closed 6 years ago

gmantele commented 6 years ago

In the configuration file, there is a property (TAP_SCHEMA) to set a mapping for TAP_SCHEMA, so that TAP-Lib is able to load the TAP content list (i.e. the published schemas, tables, ...). In that way, it is possible to specify which database schema should be considered as TAP_SCHEMA in ADQL. For instance: if my TAP_SCHEMA is named 'myDBschema' in my database, I can just tell to TAP-Lib to use this schema as TAP_SCHEMA by adding in the configuration file the following line:

TAP_SCHEMA = myDBschema

The same can be applied for standard TAP_SCHEMA tables and columns:

TAP_SCHEMA.schemas = mySchemas
TAP_SCHEMA.schemas.schema_name = sname

Doing so makes the TAP service starts....BUT, queries like below fail!

SELECT *
FROM TAP_SCHEMA.schemas

To fix this, we are forced to set the column 'dbName' of 'myDBschema' to mySchemas, in addition of the mapping already specified in the configuration file.

This ugly fix is very error prone and the library should be able to use the mapping defined in the configuration file for the initialisation, but also for queries like the simple one above.

gmantele commented 6 years ago

This issue is resolved by the commit a54065134b44c611289de59acbe4805d80670a68.

Specifying the mapping for a standard TAP_SCHEMA entry is only needed once and at only one place: the configuration file.

In this fix, the column dbName is ignored for all standard TAP_SCHEMA entries. So, whatever is written in this column in the database, TAP-Lib will just use the mapping defined in the configuration file.

If you have already defined a mapping for TAP_SCHEMA entries with dbName, do not worry, it will not break anything while migrating to this commit....TAP-Lib will just follow the mapping of the configuration file, and only this one.

molinaro-m commented 6 years ago

Thanks Gregory! This was really useful!