Some questions regarding UDF execution

CREATE QUERY test() { 
  PRINT udf_hello();
}

let says we have a tg_cluster(m1,m2,m3).

Q1 . Now when I run above query, how to figure out on which node it got executed ?

Q2 . If I have to make sure that a particular udf must be executed on all nodes of cluster, how can I achieve that ?

Hi manoj,

If you are installing a UDF with the instructions provided here, then the UDF will be installed across all nodes of the graph.

If you’re looking to have the query then execute across all nodes, you’ll need to make it a distributed query by specifying the query like this:

CREATE DISTRIBUTED QUERY test() { 
  PRINT udf_hello();
}
1 Like

Thanks @Dan_Barkus for your explanation.
I went through all the links which you have mentioned

Overview :- As per distributed-query-mode

* A set of machines representing one full copy of the entire graph will participate in the query. If the cluster has a replication factor of 2 (so there are two copies of each piece of data), then half the machines will participate.
* The query executes in parallel across all the machines which have source vertex data for a given hop in the query. That is, each SELECT statement defines a 1-hop traversal from a set of source vertices to a set of target vertices. Unlike the default mode where all the needed data are brought to one machine, in Distributed Query mode, the computation moves across the cluster, following the traversal pattern of the query.
* The output results will be gathered at one machine

Taking reference of below query

CREATE DISTRIBUTED QUERY test() { 
  PRINT udf_hello();
}

[ Understanding ]

Q1. udf_hello is not participating in any select statement, so ideally it should not be parallelized right ?

On the basis of above understanding, back to my previous question :-

Q2 . Now when I run above query, how to figure out on which node it got executed ?

Q3 . If I have to make sure that a particular udf must be executed on all nodes of cluster, how can I achieve that ?

@Jon_Herke need your help

FYI … @Songting_Chen @Zhixian_Yan