16.20 - Usage Notes - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL External Routine Programming

Product
Advanced SQL Engine
Teradata Database
Release Number
16.20
Release Date
April 2020
Content Type
Programming Reference
Publication ID
B035-1147-162K
Language
English (United States)

A table function calls FNC_GetPhaseEx before doing anything else.

Although FNC_GetPhaseEx can be used successfully by a table function that is passed in constant arguments (where the return value of FNC_GetPhaseEx is TBL_MODE_CONST), it is most useful to a table function that is passed in variable arguments (where the return value of FNC_GetPhaseEx is TBL_MODE_VARY).

The functionality that FNC_GetPhaseEx provides complements the HASH BY and LOCAL ORDER BY clauses that order input to table functions. For an example on how to order input arguments to a table function, see Ordering Input Arguments to Table UDFs.

FNC_GetPhaseEx also provides users with more control of table phase transitions when developing table functions. Users can reduce the number of phase transitions required during execution of a table function, thus reducing the number of UDF invocations and improving table function performance.