FNC_Context_t Fields | Window Aggregate Functions | Teradata Vantage - FNC_Context_t Fields - Analytics Database - Teradata Vantage

SQL External Routine Programming

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2023-07-11
dita:mapPath
iiv1628111441820.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
B035-1147
lifecycle
latest
Product Category
Teradata Vantageā„¢

The following table identifies the FNC_Context_t fields that are used by window aggregate functions. If a field is not listed in the table, it is not applicable for window aggregate functions or the field is reserved for future use.

Fields Specifies
version the version of the context structure.
interim1 a pointer to the aggregate storage area that saves intermediate results.
intrm1_length the length of interim1.
window_size
  • For the cumulative window type, this value is -1.
  • For the reporting window type, the value is -2.
  • For the moving window type, the value is set as post_window -pre_window+1 (+1 for the current row).
pre_window This value is specified as part of the PRECEDING clause. The value of this field is negative if this points to a row that precedes the current row.

This field is not applicable for the cumulative and reporting window types. It is initialized to zero in those cases.

post_window This value is specified as part of the FOLLOWING clause. The value of this field is positive if this points to a row that follows the current row.

This field is not applicable for the cumulative and reporting window types. It is initialized to zero in those cases.

Vantage sets up the following fields prior to invoking the function. The fields are used to define a window of rows for the function to operate on.
  • window_size
  • pre_window
  • post_window