16.20 - Example: Partitioning Expression that Specifies an AT LOCAL Date - Teradata Database - Teradata Vantage NewSQL Engine

Teradata Vantage™ SQL Data Definition Language Syntax and Examples

Product
Teradata Database
Teradata Vantage NewSQL Engine
Release Number
16.20
Published
March 2019
Language
English (United States)
Last Update
2019-05-24
dita:mapPath
wkf1512081455740.ditamap
dita:ditavalPath
TD_DBS_16_20_Update1.ditaval

Assume that column tsz has a TIMESTAMP(0) WITH TIME ZONE data type and the current session time zone is INTERVAL -'03:00' HOUR TO MINUTE when the join index that contains tsz is created with the following PARTITION BY clause. The data type of the partitioning expression is INTEGER.

     PARTITION BY RANGE_N(CAST(tsz AS DATE AT LOCAL) 
                          BETWEEN DATE '2003-01-01' 
                          AND     DATE '2009-12-31'
                          EACH INTERVAL '1' MONTH)

Teradata Database implicitly rewrites this partitioning expression, replacing LOCAL with a specific time zone as follows.

     PARTITION BY RANGE_N(CAST(tsz AS DATE AT '-03:00') 
                          BETWEEN DATE '2003-01-01' 
                          AND     DATE '2009-12-31'
                          EACH INTERVAL '1' MONTH)