Usage Notes - Analytics Database - Teradata Vantage

SQL Functions, Expressions, and Predicates

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2024-01-12
dita:mapPath
obm1628111499646.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
kby1472250656485
lifecycle
latest
Product Category
Teradata Vantage™

Default Arguments

Arguments Result
None HASHAMP () returns an INTEGER that is one less than the maximum number of 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.

IF the hash bucket size is … THEN the range of values for expression is …
16 bits 0 to 65,535.
20 bits 0 to 1,048,575.

For information on how to set the system hash bucket size, see “DBS Control utility” in Teradata Vantage™ - Database Utilities, B035-1102.

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

If expression results in a UDT, Vantage performs implicit type conversion on the UDT, if the UDT has an implicit cast that casts between the UDT and any of the following predefined types:
  • Numeric
  • Character
  • DATE

To define an implicit cast for a UDT, use the CREATE CAST statement and specify the AS ASSIGNMENT clause. For more information, see Teradata Vantage™ - SQL Data Definition Language Syntax and Examples, B035-1144.

Implicit type conversion of UDTs for system operators and functions, including HASHAMP, is a Teradata extension to the ANSI SQL standard. To disable this extension, set the DisableUDTImplCastForSysFuncOp field of the DBS Control Record to TRUE.