Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
1.http://www.teradatahelp.com/2010/09/how-can-you-view-data-distribution-in.html
1. http://rajgopal-gurrapushala.blogspot.com/2012/11/types-of-hash-functions-used-in-teradata_734.html
Create Table emp
(
ID BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY
(START WITH 1
INCREMENT BY 1
MINVALUE -999999999999999999
MAXVALUE 999999999999999999
NO CYCLE),
empname varchar(20),
empdept varchar(10)
)
PRIMARY INDEX(ID);
insert into emp(empname,empdept) values('D','X');
insert into emp(empname,empdept) values('C','X');
insert into emp(empname,empdept) values('B','X');
insert into emp(empname,empdept) values('A','X');
insert into emp(empname,empdept) values('A','X');
SELECT
HASHROW (EMP.empname) AS "Hash Value"
, HASHBUCKET (HASHROW (EMP.empname)) AS "Bucket Num"
, HASHAMP (HASHBUCKET (HASHROW (EMP.empname))) AS "AMP Num"
, HASHBAKAMP (HASHBUCKET (HASHROW (EMP.empname))) AS "AMP Fallback Num"
,EMP.empname
FROM EMP;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment