Creating Parallel Cast and Transform Functionality - 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™

Best practices suggest that you should provide parallel functionality for the transform group functionality and the equivalent cast functionality.

The following table explains what this means more explicitly:

Cast Functionality Equivalent Transform Functionality
External predefined data type to UDT cast External predefined data type to UDT tosql transform
UDT to external predefined data type cast UDT to external predefined data type fromsql transform

This redundant functionality is particularly recommended if you want to use a UDT in the same way you would use any other data type, especially with respect to load utilities and the USING row descriptor.

The simplest way to accomplish these equivalences is to reference the same external routines in both the CREATE TRANSFORM and CREATE CAST statements for the same UDT.

The implications of this best practice differ for distinct and structured UDTs as follows:

FOR this kind of UDT … You must do the following work to create parallel casting and transform functionality…
distinct none if you plan to use the system-generated casts and transforms.

However, if you decide to write your own external cast and transform routines for the UDT, you must create the parallel cast and transform functionality explicitly using the CREATE CAST and CREATE TRANSFORM statements, respectively.

structured create the necessary casts and transforms explicitly, using the same external routines for both.

See CREATE CAST and REPLACE CAST for information about how to create casting functionality for a UDT.