Writing UDFs

When you write UDFs, use function-oriented programming best practices, and note data type differences when transferring values from high-level SQL to low-level UDF code.

The UDF code samples that you downloaded include the udf-sample.h and udf-sample.cc files that you can reference when you write your UDFs. The udf-sample.h file provides the basic declarations required to write a scalar UDF. This file defines a simple function named AddUdf() that you can reference. The udf-sample.cc file provides sample C++ code for a simple function named AddUdf().