For AMP Number HASHMAP()+1

Analytics
Enthusiast

For AMP Number HASHMAP()+1

To find the number of Amps the query we use is -

Sel Hashmap()+1.

But why we add one saying "+1".

6 REPLIES
Enthusiast

Re: For AMP Number HASHMAP()+1

Is there any HASHMAP function exist? I know only about HASHAMP function.

I believe its typo :), well I think it is due to the fact that the amp numbers start from 0 so if there are 100 amps, then the function will return 99, and you have to add 1 to get the correct number of amps.

Khurram
Enthusiast

Re: For AMP Number HASHMAP()+1

Sorry! for the Typo. :)

another thoughts I come across from sites is that it is because one amp is not perticulerly use for table calculations as it handles the locking strategies.

Enthusiast

Re: For AMP Number HASHMAP()+1

Yes, the basic purpose of hashamp function is to analyse the row distriution base on PI values. The query used for this purpose is:

SELECT HASHAMP(HASHBUCKET(HASHROW(PI_COLUMN))) AS AMP, COUNT(*)
FROM TABLE
Group by 1
Order by 1
;
Khurram
Enthusiast

Re: For AMP Number HASHMAP()+1

thanks!

Teradata Employee

Re: For AMP Number HASHMAP()+1

thanks for the infos.

Enthusiast

Re: For AMP Number HASHMAP()+1

We add '1' cause the AMP numbering starts from 0 (zero), not 1 (one).

If your system has 32 Amps, the amps are numbered from 0 to 31. HashAmp() gives the max amp number and you add 1 to find the total number of amps.