Example: SHOW for SELECT Request with Function Mapping - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
ft:locale
en-US
ft:lastEdition
2024-12-11
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905

In this example, the SHOW for a SELECT request statement includes a function mapping definition and a foreign server definition that is part of the function mapping definition.

Following is the function mapping definition.

CREATE FUNCTION MAPPING appl_view_db.sessionize 
	FOR sessionize SERVER coprocessor 
	USING 
	    Timecolumn, timeout(100), clicklag(20), emitnull;

Following is the SHOW SELECT request.

SHOW SELECT * from test_db.sessionize ( 
   	   ON test_user.t1 as InputTable PARTITION BY 1
   	   USING
         TimeColumn('periodcol'), 
         clicklag(200)
	) as dt;

The SHOW request statement returns the definitions of the table, the function mapping, and the foreign server. (The table is on the Block File System.)

*** Text of DDL statement returned.
-------------------------------------------------------------------
CREATE SET TABLE TEST_USER.t1 ,NO FALLBACK ,
     NO BEFORE JOURNAL,
     NO AFTER JOURNAL,
     CHECKSUM = DEFAULT,
     DEFAULT MERGEBLOCKRATIO,
     MAP = TD_MAP1
     (
      userid INTEGER,
      periodcol TIMESTAMP(6),
      page VARCHAR(1000) CHARACTER SET LATIN NOT CASESPECIFIC)
PRIMARY INDEX ( userid );
*** Text of DDL statement returned.
-------------------------------------------------------------------
CREATE FUNCTION MAPPING appl_view_db.sessionize 
FOR sessionize SERVER coprocessor 
USING 
Timecolumn, timeout(100), clicklag(20), emitnull;
*** Text of DDL statement returned.
-------------------------------------------------------------------
CREATE FOREIGN SERVER TD_SERVER_DB.opt_srv1
EXTERNAL SECURITY DEFINER TRUSTED TESTAUTH USING
link  ('sdlc4673sdlc4675')
version  ('active')
DO IMPORT WITH TD_SYSFNLIB.QGINITIATORIMPORT ,
DO EXPORT WITH TD_SYSFNLIB.QGINITIATOREXPORT ;