UDF Documentation

Hey all!

I’m doing some poking around with UDFs and I’ve not been able to find much documentation on them. Specifically, using accumulators and other GSQL types in the UDF (whether they’re arguments, or instantiated in the UDF itself).

If there’s something I haven’t found yet, please let me know.

Thanks,
A newbie to C++

If there are no other UDF docs, a good start would be accessing vertex attributes from the UDF (assuming the vertex is passed as an arg)

@Jon_Herke hopefully I’m not bugging you on vacation or something… Any idea?

@robrossmiller not vacation just preparing for a big conference. I would like to bring a few TigferGraph folks in on our side 1 from our documentation team and the other from the solutions team. Do you still have my email? If not we can 1:1 direct message. Once we layout the shortcomings of the documentations we can work on getting those resolved asap and update this threa.

@Richard_Henderson Jon says you may be able to help here?

I’m trying to do something like this:

my_udf(VERTEX& v){
  // for each attribute in the vertex
  for(VertexAttribute attr: v.attributes){
    // do something based on the attribute's type
    switch(typeid(a).name()) {
      case "s" :
        str_statement(attr);
        break; 
      case "i"  :
        int_statement(attr);
        break;  
    }
  }
}

This way, I can write one udf that will handle any and all vertex types.
Going into it, we don’t need to no how many attributes, their names or types.

Is there some documentation on using a vertex’s attribute like this?