postgrespro / vops

Other
166 stars 22 forks source link

JDBC mapping, COPY via JDBC? #6

Closed yazun closed 12 months ago

yazun commented 6 years ago

Hello,

Would it be possible to use it via JDBC driver (to both populate entities via COPY interface and fetch via standard JDBC)? We would need support of these two functionalities in order to use it (as an extension, not FDW).

Cheers Krzysztof@ESA Gaia

knizhnik commented 6 years ago

VOPS defines its own types,i.e. vops_float4, vops_int8... For this types VOPS provides functions for parsing/deparsing - convert ti to/from string. So, obviously there is no mapping from VOPS type to some Java type, but you can fetch value of VOPS type as string.

But in most cases you do no need to deal with VOPS types in your Java application. VOPS tables are intended to be used in some analytic queries, calculating some aggregates... If you calculate grand aggregate (select sum(x) from T), then it will have scalar value (i.e. double) and you can fetch it in normal way. In more complex cases, you can use VOPS unnest() to convert VOPS table to normal representation (horizontal tables).