16.20 - Return Value - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL External Routine Programming

Product
Advanced SQL Engine
Teradata Database
Release Number
16.20
Release Date
April 2020
Content Type
Programming Reference
Publication ID
B035-1147-162K
Language
English (United States)

A pointer to an FNC_Node_Info_t structure, which lists the online AMPs.

FNC_Node_Info_t is defined as:

typedef  struct FNC_Node_Info_t {
      int NumAMPNodes;
      int NumAMPs;
      AMP_Node_t AN[1]; /* number varies with number of AMP vprocs */
                        /* (one per AMP vproc) */
   } FNC_Node_Info_t;
Member ... Specifies ...
NumAMPNodes

the total number of AMPs on the same node as the invoking AMP.

If this function is invoked from a table operator that is associated with a map, then NumAMPNodes is the total number of AMPs on the same node within the specified map.

NumAMPs

the total number of AMPs that are in online or hold state within the same node as the invoking AMP.

If this function is invoked from a table operator that is associated with a map, then NumAMPs is the total number of AMPs that are in online or hold state within the specified map and on the same node as the invoking AMP.

AMP_Node_t an array listing the node IDs and AMP IDs of the online AMP vprocs. The value of NumAMPs determines the number of elements in the array. AMP_Node_t is defined as:
typedef struct AMP_Node_t
{
    unsigned short NodeId;
    unsigned short AMPId;
} AMP_Node_t;
  • NodeId specifies the unique number of the node.
  • AMPId specifies the unique number of the AMP.

The information is in ascending order, first by NodeId and then by AMPId.

In the event of a node failure, a HSN (hot standby node) takes over the online AMP vprocs from the failed node. In this case, FNC_TblGetNodeData returns the node ID of the HSN instead of the failed node. Therefore, you may get results that are not in the order expected with regards to the node ID.