EXPAND_ON_UDF
Definition
Reproduces the functionality of the expand-on function in Teradata.
PUBLIC.EXPAND_ON_UDF(TIME STRING, SEQ NUMBER, PERIOD STRING)Parameters
TIME STRING
The expand-on time used in nachor.
SEQ NUMBER
The sequence to calculate each row.
PERIOD STRING
The date from the period required.
Returns
A VARCHAR that represents the calculation of the expand-on clause for the period.
Migration example
Input:
SELECT bg FROM table1 EXPAND ON pd AS bg BY ANCHOR ANCHOR_SECOND;Output:
WITH
ExpandOnCTE AS
(
SELECT
PUBLIC.EXPAND_ON_UDF('ANCHOR_SECOND', VALUE, pd) bg
FROM
table1,
TABLE(FLATTEN(PUBLIC.ROW_COUNT_UDF(PUBLIC.DIFF_TIME_PERIOD_UDF('ANCHOR_SECOND', pd))))
)
SELECT
bg
FROM
table1,
ExpandOnCTE;Last updated
