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

SQL External Routine Programming

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Published
July 2021
Language
English (United States)
Last Update
2021-07-27
dita:mapPath
rin1593638965306.ditamap
dita:ditavalPath
rin1593638965306.ditaval
dita:id
B035-1147
lifecycle
previous
Product Category
Teradata Vantage™

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.