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

Teradata Vantage™ - SQL External Routine Programming

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1147-171K
Language
English (United States)

Syntax

import com.teradata.fnc.*;
import java.io.*;
import java.sql.*;

public class  class_name  {
  ...
  public static  result_type   method_name  (
   Phase phase,
   Context[] context,
   [ input_parameter_specification [,...] ]
  )
  {
    ...
  }
}
input_parameter_specification
type *input_parameter

Syntax Elements

result_type
a Java primitive or class corresponding to the SQL data type in the RETURNS clause of the corresponding CREATE FUNCTION statement.
phase
a required parameter that lets Vantage 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.
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.
input_parameter_specification
[Optional] Type and name of an input parameter in the CREATE FUNCTION definition. Each input parameter in the definition must have a corresponding input_parameter_specification. The maximum number of input parameters is 128.
The type is a Java primitive or class that corresponds to the SQL data type of input_parameter.