Example: Identifying AMPs for a Table with a Sparse Map - Analytics Database - Teradata Vantage

SQL Operators and User-Defined Functions

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-04-05
dita:mapPath
xub1628111590556.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
drp1544241916620
lifecycle
latest
Product Category
Teradata Vantage™

Use the function SYSLIB.SparseTableAMPs to identify the AMPs for a specific table in a sparse map.

SELECT SYSLIB.SparseTableAMPs('db1','tab1') AS AMPList;

Result:

AMPList
-------------------------------------------   
      1    202    543  32454

Use the following query to convert the function's result to a comma separated form.

SELECT REGEXP_REPLACE(TRIM(LEADING FROM
         SYSLIB.SparseTableAMPs('db1','tab1')), ' +', ',') AS AMPList;

Result:

AMPList
-------------------------------------------
1,202,543,32454