Understanding Map Routines | CREATE ORDERING | Teradata Vantage - High-Level Description of How MAP Routines Work - Analytics Database - Teradata Vantage

SQL Data Definition Language Detailed Topics

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
vuk1628111288877.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
jbg1472252759029
lifecycle
latest
Product Category
Teradata Vantage™

When you compare two values of a given UDT, the system invokes the MAP routine for each of them, then compares the returned values from the MAP routine invocations. Returned values can be specified to have any predefined data type except BLOB or CLOB, and the result of the UDT data type comparison is the same as the result of comparing the returned predefined type values.

The following notation represents the various types of variables used to specify the values to be compared and the external routines used to compare them:
  • Let x and y represent the respective values of the UDT to be compared.
  • The following table indicates the notation used to represent UDFs and methods:
    IF the MAP routine is this type of external routine … THEN use the following notation to represent it …
    user-defined method M()
    user-defined function F

The following table provides examples of the relationships between different values of the same UDT and the user-defined methods used to operate on them:

IF the following method mappings evaluate to TRUE … THEN the result of x comparison_operator y is …
x.M() = Y.M() x = Y
x.M() < Y.M() x < Y
x.M() <> Y.M() x <> Y
x.M() > Y.M() x > Y
x.M() ≤ Y.M() xY
x.M() ≥ Y.M() xY

The following table provides examples of the relationships between different values of the same UDT and the user-defined functions used to operate on them:

IF the following UDF mappings evaluate to TRUE … THEN the result of x comparison_operator y is …
F(x) = F(y) x = y
F(x) < F(y) x < y
F(x) <> F(y) x <> y
F(x) > F(y) x > y
F(x) ≤ F(y) xy
F(x) ≥ F(y) xy