Last active
December 21, 2021 04:24
-
-
Save anjijava16/5d151cfc430124a505116fa61e30c513 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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