The Vertica Forum recently got a makeover! Let us know what you think by filling out this short, anonymous survey.
Please take this survey to help us learn more about how you use third party tools. Your input is greatly appreciated!
JAVA SDK working with complex types in v11
It looks like for UDx, one can use C++ SDK to read and write complex types, but I am not seeing such capability in Java.
Can u please confirm that is the case? If so, what is the plan and ETA for making it available?
Complex Types are supported as mentioned here:
thanks, is there an example for UDx in Java? Thanks
After you install Vertica check the files under /opt/vertica/sdk/examples
There are also sql examples which use Java functions:
See also this blog:
Thanks, @mosheg. My question is really JAVA API for Complex type under UDTF setting.
In c++, one can read complex types through BlockReader, such as, Array::ArrayReader getArrayRef (size_t idx) const
however, in java, getArrayRef does not exist:
Complex Types for C++ SDK is ready for use, but for Java SDK it's not available yet.
Complex Types for Python SDK will come sooner.
Do you have an ETA on JAVA SDK?
We don't have an ETA for that yet.
What is the ETA for python then?
For JAVA, is there anything a client can do to make the request, so it starts earlier?
@BHIFP : Sure. Please open a support case and mention share the details of using complex types with JAVA SDK. we can raise a request with Engineering and take it from there.
There is no need to wait for Vertica to release support for complex types in Java UDx API.
Idea is to cast arrays into varbinary and back, and pass to/from Java UDx varbinary instead arrays.
You can rather easy cast arrays back and forth to varbinary. It is done with type converting c++ UDx scalar function that takes one argument and return one, without value change, just change type array->varbinary.
Now, you can get array arguments in Java UDx as varbinary, by converting argument with help of c++ function. If you want to output result as array, output as varbinary, convert to array with help of same c++ function.
Performance of c++ type conversion function would be fine, especially in non-fenced mode. Java UDx is slow enough so you won't see difference with use of c++ type conversion functions and future native support of arrays in Java UDx.
Type converting arrays - varbinary in c++ are trivial, code can be done in couple hours.
Which version of Java 11 should I use?
You can use any recent Java version, and you'll need the JDBC driver v11.1 or later, which can be obtained here: https://www.vertica.com/download/vertica/client-drivers/
Sure thank you