HASHAMP Usage Notes - Teradata VantageCloud Lake

Lake - Working with SQL

Deployment
VantageCloud
Edition
Lake
Product
Teradata VantageCloud Lake
Release Number
Published
February 2025
ft:locale
en-US
ft:lastEdition
2025-11-21
dita:mapPath
jbe1714339405530.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
jbe1714339405530

Default Arguments

Arguments Result
None HASHAMP ( ) returns an INTEGER that is one less than the maximum number of Permanent AMPs in the system.
expression is not specified For a contiguous map: The function returns an INTEGER representing the highest AMP number in the specified or default contiguous map. For a contiguous map starting at AMP zero, adding one to the result gives the total number of AMPs in the contiguous map. For a sparse map: Expression must be specified for a sparse map.
expression is specified The function returns the ID of the primary AMP corresponding to the hash bucket number specified in expression, based on the specified or default map.

Default Map

To determine the default map, the system evaluates the following, in order, and uses the first map found:

  1. User profile.
  2. User.
  3. System.

Expression

The expression argument must evaluate to an INTEGER data type where the range of valid values depends on the system hash bucket size.

Hash Bucket Size Range of Values for expression
16 bits 0 to 65,535.
20 bits 0 to 1,048,575.

If expression cannot be implicitly converted to an INTEGER, an error is reported.

Implicit type conversion of UDTs for system operators and functions, including HASHAMP, is a Teradata extension to the ANSI SQL standard.