EXECUTE MAP Clause - Teradata Database - Teradata Vantage NewSQL Engine

SQL Data Manipulation Language

Product
Teradata Database
Teradata Vantage NewSQL Engine
Release Number
16.20
Published
March 2019
Language
English (United States)
Last Update
2019-05-03
dita:mapPath
fbo1512081269404.ditamap
dita:ditavalPath
TD_DBS_16_20_Update1.ditaval
dita:id
B035-1146
lifecycle
previous
Product Category
Teradata Vantage™

Specify a contiguous or sparse map and, optionally, colocation name for table operator execution. The table operator executes only on the AMPs in the map. The database distributes input rows to the AMPs in the specified or default map before running the table operator on the specified or default map if the input rows are not already distributed per that map.

You must have been granted the specified map.

When the EXECUTE MAP clause is not specified, the execute map will be as defined by the table operator. See the EXECUTE MAP option under CREATE FUNCTION and REPLACE FUNCTION (Table Form) in User-Defined Function Statements of Teradata Vantage™ SQL Data Definition Language Syntax and Examples, B035-1144.

map_name
Name of contiguous or sparse map.
You cannot specify TD_DataDictonaryMap or TD_GlobalMap.
COLOCATE USING colocation_name
Name for colocating the function on the same AMPs with other functions, tables, join indexes, or hash indexes.
You can only specify this option for a sparse map. For a contiguous map, a colocation name is not needed for colocation and the colocation_name is set to NULL.
If you do not specify a colocation name, the name defaults to database_operator, where database is the name of the database or user followed by an underscore (_) and operator is the name of the table operator. If database exceeds 63 characters, database is truncated to 63 characters. If operator exceeds 64 characters, operator is truncated to 64 characters.

Example: Specifying a Sparse Map for a Table Operator

Because this example specifies a sparse map, colocation_name defaults to db1_tableop1, which overrides the colocation name specified, if any, when the table operator was created.

SELECT * FROM db1.tableop1
    ( ON ( SELECT * FROM tab1) PARTITION BY col1
      ON ( SELECT * FROM tab2) PARTITION BY col2
      EXECUTE MAP = OneAMPMap
      USING myvalue(10,20)
    ) AS d1;