Method Signature for Aggregate UDFs - Advanced SQL Engine - Teradata Database

SQL External Routine Programming

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-24
dita:mapPath
qwr1571437338192.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1147
lifecycle
previous
Product Category
Teradata Vantage™
import com.teradata.fnc.*;
import java.io.*;
import java.sql.*;

public class  class_name  {

   ...

   public static  result_type   method_name  ( Phase  phase,
                                           Context[]  context,
                                           type_1      input_param_1,
                                           ...,
                                           type_n      input_param_n)
   {
        ...
   }
}

where:

Return Type/Parameter … Specifies …
result_type a Java primitive or class corresponding to the SQL data type in the RETURNS clause of the corresponding CREATE FUNCTION statement.
com.teradata.fnc.Phase phase a required parameter that lets Teradata Database pass in the current aggregation phase. The aggregation phase determines how the method processes the data passed in.

For details on the Phase class, see com.teradata.fnc.Phase.

com.teradata.fnc.Context[] context a required parameter that provides a way for the method to access intermediate storage to combine data passed in during the various aggregation phases.

For details on the Context class, see com.teradata.fnc.Context.

type_n input_param_n the input parameters, where n is the number of parameters in the CREATE FUNCTION definition. If n = 0, no input parameters appear. The type is a Java primitive or class corresponding to the SQL data type of the input argument.

The maximum number of input parameters is 128.