REPLACE FUNCTION and Algorithmic Compression - 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™

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.