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

SQL Data Definition Language Syntax and Examples

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
2024-10-04
dita:mapPath
jco1628111346878.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
mdr1472255012272
lifecycle
latest
Product Category
Teradata Vantage™

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.

Below 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.

*** 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 ;