Table and Data Definition for MERGE Examples - Analytics Database - Teradata Vantage

Time Series Tables and Operations

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
2023-10-30
dita:mapPath
tuc1628112453431.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
sfz1493079039055
lifecycle
latest
Product Category
Teradata Vantageā„¢

Following are the definitions of the tables used in the examples.

Here is the table definition for the sequenced PTI table src_s, which includes a time zero specification of October 15, 2016, DATE '2016-10-15', and time bucket duration of 1 hour, HOURS(1).

CREATE TABLE src_s(
      TD_TIMEBUCKET BIGINT NOT NULL GENERATED SYSTEM TIMECOLUMN,
      TD_TIMECODE TIMESTAMP(1) NOT NULL GENERATED TIMECOLUMN,
      TD_SEQNO INT NOT NULL GENERATED TIMECOLUMN,
      c1 INTEGER,
      c2 INTEGER)
 PRIMARY TIME INDEX (TIMESTAMP(1), DATE '2016-10-15', HOURS(1), COLUMNS(C1), SEQUENCED(500));

Below is the table definition for the sequenced PTI table tgt_s, which includes a time zero specification of October 15, 2016, DATE '2016-10-15', and time bucket duration of 1 hour, HOURS(1).

CREATE TABLE tgt_s(
      TD_TIMEBUCKET BIGINT NOT NULL GENERATED SYSTEM TIMECOLUMN,
      TD_TIMECODE TIMESTAMP(1) NOT NULL GENERATED TIMECOLUMN,
      TD_SEQNO INT NOT NULL GENERATED TIMECOLUMN,
      c1 INTEGER,
      c2 INTEGER)
 PRIMARY TIME INDEX (TIMESTAMP(1), DATE '2016-10-15', HOURS(1), COLUMNS(C1), SEQUENCED(500));

Here is the table definition for the sequenced PTI table tgt_s2, which includes a time zero specification of October 15, 2016, DATE '2016-10-15', and time bucket duration of 2 hours, HOURS(2).

CREATE TABLE tgt_s2(
      TD_TIMEBUCKET BIGINT NOT NULL GENERATED SYSTEM TIMECOLUMN,
      TD_TIMECODE TIMESTAMP(1) NOT NULL GENERATED TIMECOLUMN,
      TD_SEQNO INT NOT NULL GENERATED TIMECOLUMN,
      c1 INTEGER,
      c2 INTEGER)
 PRIMARY TIME INDEX (TIMESTAMP(1), DATE '2016-10-15', HOURS(2), COLUMNS(C1), SEQUENCED(500));