Phases of a Variable Mode Table UDF - 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™

Teradata Database repeatedly invokes the Java method for a variable mode table UDF, allowing the method to pass through different phases where it initializes itself, accesses system resources, and builds output rows. The method uses Tbl.getPhase() or Tbl.getPhaseEx() to determine which phase it is in and what action to take.

A method that uses Tbl.getPhase() passes through the following phases:



Alternatively, a table UDF that needs to know when it is passed in the last qualified row on an AMP (perhaps because the UDF does not return a row until after it processes all of the input rows) can use Tbl.getPhaseEx() with the TBL_LASTROW option and pass through the following phases:



For details on implementing each phase of a variable mode table UDF, see Implementation Guidelines.