Function Mapping and the ON Clause - Teradata VantageCloud Lake

Lake - Working with SQL

Deployment
VantageCloud
Edition
Lake
Product
Teradata VantageCloud Lake
Release Number
Published
February 2025
ft:locale
en-US
ft:lastEdition
2025-11-21
dita:mapPath
jbe1714339405530.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
jbe1714339405530

For information on how to create a function mapping, see CREATE FUNCTION MAPPING.

The correlation_name must correspond to a name IN TABLE parameter in the function mapping definition. The correlation_name can be any name if the function mapping definition specifies ANY IN TABLE.

The following statement defines the function mapping Attribution.

CREATE FUNCTION MAPPING appl_view_db.Attribution
   FOR attribution SERVER coprocessor 
   MAP JSON ( '{ "function_version": "1.0" }') 
   USING
      ANY IN TABLE,
      conversion IN TABLE,
      excluding IN TABLE,
      optional IN TABLE,
      model1 IN TABLE,
      model2 IN TABLE,
      EventColumn, TimestampColumn, WindowSize;

The following SELECT statement runs the function mapping Attribution.

SELECT * FROM appl_view_db.Attribution ( 
         ON appl_view_db.input_table PARTITION BY 1
         ON appl_view_db.model1 AS model1 DIMENSION
         USING
            TimestampColumn('tscol')
            EventColumn('eventcol')
            WindowSize('rows:10')
) AS dt;