Row Hash Validation Example - Teradata Ecosystem Manager

Teradata Ecosystem Manager User Guide

Product
Teradata Ecosystem Manager
Release Number
15.11
Published
May 2016
Language
English (United States)
Last Update
2018-05-03
dita:mapPath
nao1467305810726.ditamap
dita:ditavalPath
ft:empty
dita:id
B035-3201
lifecycle
previous
Product Category
Analytical Ecosystem

You can enter a custom validation up to 500 characters. You can specify the aggregate function, such as AVG, MIN, MAX, and COUNT.

For example, for a table with the following definition:

CREATE SET TABLE SampleDC
     		(
      EcosystemId VARCHAR(20) CHARACTER SET UNICODE NOT CASESPECIFIC NOT NULL,
      EcosystemName VARCHAR(30) CHARACTER SET UNICODE NOT CASESPECIFIC,
      DefaultTDPID VARCHAR(72) CHARACTER SET UNICODE NOT CASESPECIFIC,
      CreatedTS TIMESTAMP(6) DEFAULT CURRENT_TIMESTAMP(6),
      ModifiedTS TIMESTAMP(6) DEFAULT CURRENT_TIMESTAMP(6),
      TMSMUserId VARCHAR(64) CHARACTER SET UNICODE NOT CASESPECIFIC)
UNIQUE PRIMARY INDEX UPI ( EcosystemId 
);

Then you can enter a customized row hash validation expression for the most reliable checksum of the table contents:

SELECT (SUM(CAST(HASHBUCKET(HASHROW(EcosystemID, Ecosystemname, DefaultTPDID, CreatedTS,ModifiedTS,TMSMUserId)) AS
DECIMAL(38,0))) MOD 111111111111111) as checksum FROM SampleDC;

For this example, hashing is presumed the same on all Teradata systems involved in the table validation.