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:https://www.vertica.com/docs/11.1.x/HTML/Content/Authoring/ConnectingToVertica/ClientJDBC/ComplexTypesInJDBC.htm
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:https://www.vertica.com/blog/using-java-udx-vertica/
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.
Can't find what you're looking for? Search the Vertica Documentation, Knowledge Base, or Blog for more information.