REPLACE FUNCTION and Algorithmic Compression - Advanced SQL Engine - Teradata Database

SQL Data Definition Language Detailed Topics

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Published
July 2021
Language
English (United States)
Last Update
2021-07-27
dita:mapPath
imq1591724555718.ditamap
dita:ditavalPath
imq1591724555718.ditaval
dita:id
B035-1184
lifecycle
previous
Product Category
Teradata Vantage™

You can only submit a REPLACE FUNCTION request if the compression-related function is not used by any column across all databases and users for compressing and decompressing its data. This restriction is necessary because column data is already compressed using a certain algorithm and cannot be decompressed if the algorithm is changed.

The only exception to this rule is that a REPLACE FUNCTION request involving algorithmic compression is valid if it does not change the existing function specification in the data dictionary and its execution mode is PROTECTED.

For example, consider the following DDL requests where the objects are created in the order indicated.

     CREATE FUNCTION scsu_comp …;
     CREATE FUNCTION scsu_decomp …;
     CREATE TABLE t1 (
       col_1 INTEGER,
       col_2 CHARACTER(10) COMPRESS ('abc', 'efg')
                           COMPRESS USING scsu_comp
                           DECOMPRESS USING scsu_decomp);

Column col_2 in table t1 references the UDFs scsu_comp for algorithmic compression and scsu_decomp for algorithmic decompression.

After table t1 has been created, a REPLACE FUNCTION request on either scsu_comp scsu_decomp returns an error to the requestor. This assumes that the exception conditions noted earlier are not satisfied.