Hi guys,
Do you guys know if a UDx (either written in C++, R or Java) can communicate back to Vertica? That is, can the UDx itself connect back to the DB (i.e. using ODBC or JDVC) and get query the DB?
I found in the documentation where it says “The external procedure cannot communicate back to HP Vertica.” in the “Using External Procedures” section of the “Extending HP Vertica” document, but I can’t find any indication that a UDx cannot.
Thank you
Can a UDx communicate back to the DB?
Moderator: NorbertKrupa
Can a UDx communicate back to the DB?
Have a GREAT day!
Re: Can a UDx communicate back to the DB?
Hi Sarah,
I haven’t written a UDx that does that, but my understanding is that a UDx can do anything that you choose to code. You would need to consider if the UDx is running across multiple partitions in parallel and how that would interract with the database.
—Sharon
I haven’t written a UDx that does that, but my understanding is that a UDx can do anything that you choose to code. You would need to consider if the UDx is running across multiple partitions in parallel and how that would interract with the database.
—Sharon
Sharon Cutter
Vertica Consultant, Zazz Technologies LLC
Vertica Consultant, Zazz Technologies LLC
Re: Can a UDx communicate back to the DB?
Scutter, thank you for your response!
What do you mean by "...if the UDx is running across multiple partitions in parallel"?
What do you mean by "...if the UDx is running across multiple partitions in parallel"?
Have a GREAT day!
Re: Can a UDx communicate back to the DB?
Hi Sarah,
Suppose you create a UDTF and your logic for the UDTF is in the processPartition() method. You probably wouldn’t want a query to the database to occur within processPartition() because that method will be invoked for every partition of data - so potentially many times on each node.
Most UDxs have some form of parallelism, just like any operator that is running within Veritca.
The UDx framework does have a setup() method that is invoked once per instance. That might be a place where a query that only needs to be executed once could be placed. But I am speculating. I’ve written UDxs but they have been of the more typical variety where all they do is process the incoming data and send back a result set.
—Sharon
Suppose you create a UDTF and your logic for the UDTF is in the processPartition() method. You probably wouldn’t want a query to the database to occur within processPartition() because that method will be invoked for every partition of data - so potentially many times on each node.
Most UDxs have some form of parallelism, just like any operator that is running within Veritca.
The UDx framework does have a setup() method that is invoked once per instance. That might be a place where a query that only needs to be executed once could be placed. But I am speculating. I’ve written UDxs but they have been of the more typical variety where all they do is process the incoming data and send back a result set.
—Sharon
Sharon Cutter
Vertica Consultant, Zazz Technologies LLC
Vertica Consultant, Zazz Technologies LLC