...
Built-in function | Predefined UDF | TMUDF (not predefined) | |
---|---|---|---|
Language | C++ | C++, Java | C++, Java |
Interface | Complex internal interface | TMUDF interface | TMUDF interface |
Privileges | Anyone can execute built-in functions | Depends on UDFAnyone can execute predefined UDFs | Grant/revoke |
Name | One-part name | One-part name, can be eclipsed by a UDF of the same name in the default schema | 3-part name |
Metadata | Hard-wired in source code | No metadata in metadata tables, uses TMUDF compiler interface | Metadata tables and optional TMUDF compiler interface |
Syntax | Special syntax can be defined in Trafodion parser | UDF syntax or special syntax, defined in Trafodion parser | UDF syntax only |
Execution | In the Trafodion engine (master executor, ESP) | In a separate tdm_udrserv process | In a separate tdm_udrserv process |
If you want to add a predefined TMUDF, you can follow the example of an existing one: https://github.com/apache/trafodion/blob/master/core/sql/sqludr/SqlUdrPredefTimeSeries.cpp. There are other predefined UDFs like event_log_reader and jdbc, but those should have been made regular UDRs (mea culpa), since not all system administrators may want to give access to those UDFs.
Built-in Functions
The tightest integration can of course be achieved by adding to one of the class hierarchies in Trafodion. Here are the main ones used to extend the code:
...