Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for numerical arrays #120

Open
vforchi opened this issue Jan 27, 2020 · 1 comment
Open

Support for numerical arrays #120

vforchi opened this issue Jan 27, 2020 · 1 comment
Assignees
Labels

Comments

@vforchi
Copy link
Contributor

vforchi commented Jan 27, 2020

I would like to store an array in a column of my TAP_SCHEMA, but since my DBMS (SQLServer) does not support this feature, I was thinking about saving it as a comma separated string.
Is it possible to tell vollt to convert the string into an array. I was looking at the JDBCTranslator, but it doesn't seem like the method convertTypeFromDB is exactly what I need.

@gmantele
Copy link
Owner

Indeed, this function just converts the name of the type ; it does not convert a column value. But you may still need to tell JDBCTranslator about the conversion from string (DBMS/SQL) into array (TAP/ADQL).

Anyway, the right place to look at is: tap.data.ResultSetTableIterator.formatColValue(...)
You will have to extend this class and overwrite this function to also include your conversion. Of couse, this operation will have to be done only for columns you marked (somehow) as tables.

Then, you'll have to extend tap.db.JDBCConnection and overwrite createTableIterator(...) so that it returns an instance of your extended ResultSetTableIterator.

The final step is to tell your TAPFactory to return your extended JDBCConnection ; overwrite the function getConnection(...) of your TAPFactory. If you are using the configuration file, you will have to extend ConfigurableTAPFactory and give its path in your configuration file.

Sorry that it can not be easier to do. In a future release I intend to support arrays in some way (see #82 and #81 ). Your idea is interresting ; I think it could be included in VOLLT.

@gmantele gmantele self-assigned this Jan 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants