17.00 - GetEvent Queries - Parallel Transporter

Teradata® Parallel Transporter Application Programming Interface Programmer Guide

prodname
Parallel Transporter
vrm_release
17.00
created_date
June 2020
category
Programming Reference
featnum
B035-2516-220K

All events must be queried after the driver has initiated and before it has terminated. Events queried before their data is available return TD_Unavailable.

The following table lists events that may be used with the Connection object’s GetEvent function to retrieve run time statistics from the Stream driver.

Event Returned Value
TD_Evt_ApplyCount A buffer containing the concatenation of these fields in the following order:
  1. A 4-byte unsigned integer that represents the statement number in the DML Group.
  2. A 1-byte character that represents the type of DML statement. Valid values are I (insert), U (update), or D (delete).
  3. A 4-byte unsigned integer representing the length of the database name in bytes.

    n -byte character string for the database name (where n is the length of the database name in bytes).

  4. n-byte character string for the database name (where n is the length of the database name in bytes).
  5. A 4-byte unsigned integer representing the length of the table or macro name.
  6. n-byte character string for the table or macro name (where n is the length of the table or macro name in bytes).
  7. A 4-byte unsigned integer for the number of rows inserted, updated, or deleted. If the type was I (see field 2) then this number is the number of rows inserted.

For more information on using TD_Evt_ApplyCount to get the number of rows inserted, updated, or deleted for each DML Group in the job, see Obtaining the Row Count Using TD_Evt_ApplyCount.

TD_Evt_CLIError One 4-byte integer for the CLIv2 error number and a 255 byte character buffer for the CLIv2 error text. Query this event at any time.
TD_Evt_BufferLayout Four 4-byte unsigned integers corresponding to the maximum buffer size, the row header size, the row length size, and the buffer trailer size. Use this information to format the buffer required for block streaming.

These layout values will change depending on the user environment, and may be defined differently in future releases. Always obtain these values from the event method before buffering data.

Query this event at any time.

TD_Evt_DBSError One 4-byte integer for the database error number and a 255-byte character buffer for the database error text. Query this event at any time.
TD_Evt_ConnectStatus Three 4-byte integers corresponding to the number of sessions requested, the number of sessions connected, and any CLIv2 error number that may have occurred during the connect process. Query this event at any time.
TD_Evt_CPUTime One 8-byte double for the CPU time of the instance in seconds. Query this event at any time.
TD_Evt_LoadPhaseStats One 4-byte unsigned integer for the loading phase elapsed time and three 8-byte double for the loading phase CPU time, for megabytes per second, and for megabytes per CPU second.

Query this event after the start of data loading.

The elapsed time is at the job level. The elapsed time may be slightly different between the instances. The main instance will have the most accurate elapsed time.

The CPU time, megabytes per second, and megabytes per CPU second are at the instance level.

TD_Evt_PackFactor A pointer to an integer containing the value of the pack factor.

Query this event only after initiating connection and before terminating a connection to return the pack factor for the Stream driver.

TD_Evt_OperVersion A pointer to a character string containing the driver version. Query this event only after the driver has been initiated.

TD_Evt_QueryBandByteCount All the instances return a 4-byte unsigned value for the number of internal Query Band data bytes sent to the database. All instances of the Stream Driver log on one control SQL session.
TD_Evt_RowCounts Three 4-byte unsigned integers corresponding to the number of rows received, rows sent, and rows that caused database errors. Query this event before EndAcquisition to get the current number of rows received. The rest of the data for this event, however, will only be available after EndAcquisition.
TD_Evt_RowCounts64 Three 8-byte unsigned integers corresponding to the number of rows received, sent, and applied. This event can be queried anytime before EndAcquisition to get the current number of rows received. The rest of the data for this event is available after ApplyRows.

If rows are being loaded using PutRow, the data for this event will not be available until enough rows have been loaded to fill one internal buffer or until the Checkpoint function has been called.

The rows-applied count returned by this event does not take into consideration rows that are rejected by the database during the application phase. Query the TD_Evt_ApplyCount event to get the final count of rows that have been applied to the target table.

TD_Evt_RowsDiscarded One 8-byte unsigned integer for the number of rows discarded by the operator. Query this event after Acquisition phase.
TD_Evt_RunStats Five 4-byte unsigned integers corresponding to the number of SQL statements sent to the database, requests sent to the database, rows received, rows sent, and rows that caused errors. Query this event before EndAcquisition to get the current number of rows received. The rest of the data for this event, however, will only be available after EndAcquisition.
TD_Evt_RunStats64 Five 8-byte unsigned integers corresponding to the number of SQL statements sent to the database, the requests sent to the database, the rows received, the rows sent, and the rows that caused errors. Query this event before EndAcquisition to get the current number of rows received. The rest of the data for this event, however, will only be available after EndAcquisition.
TD_Evt_ErrorTable1 One 4-byte unsigned integer for the number of rows in error table 1. Query this event after the first call to PutRow or PutBuffer.
TD_Evt_ErrorTable1_64 One 8-byte unsigned integer for the number of rows in error table 1. Query this event after the first call to PutRow or PutBuffer
TD_Evt_ExitCode One 2-byte integer for the exit code of the driver. Query this event right before the driver terminates.
TD_Evt_RowsCheckpointed One 4-byte unsigned integer corresponding to the total number of rows that have been received and checkpointed for the entire job. Query this event any time after initiating a Teradata PT database connection in a single-instance job. This event will return TD_Unavailable when queried in a job containing multiple instances; this event is invalid if multiple instances are used.

Note that the event data returned by this event can be used as a replacement for the checkpoint data that must be passed into the Restart method during a restart job. It is recommended to save the checkpoint data from the last successful call to the CheckPoint method in a potential restart job. However, if the checkpoint data is not saved then the event data returned by this event can be passed into the Restart method instead. This alternate method of performing checkpoint/restarts will only work with single-instance jobs.

TD_Evt_RowsCheckpointed64 One 8-byte unsigned integer corresponding to the total number of rows that have been received and checkpointed for the entire job. Query this event anytime after initiating a Teradata PT API database connection in a single-instance job. This event will return TD_Unavailable when queried in a job containing multiple instances; this event is invalid if multiple instances are used.

Note that the event data returned by this event can be used as a replacement for the checkpoint data that must be passed into the Restart method during a restart job. It is recommended to always save the checkpoint data from the last successful call to the CheckPoint method in a potential restart job. However, if the checkpoint data is not saved, then the event data returned by this event can be passed into the Restart method instead. This alternate method of performing checkpoint/restarts will only work with single-instance jobs.

TD_Evt_SessionNodeID A pointer to a character string containing the information about the SessionNodeID for all the job sessions.
Data in the SessionNodeID for every session contains the following information:
  • First 4 bytes will contain the database session number.
  • Next 2 bytes will contain Session type.
  • Next 2 bytes will contain the unformatted node ID.
  • Next 4 bytes will contain length(n) of the formatted node-ID.
  • Next 'n' bytes will contain formatted node ID.

This event can be queried only after the operator has been initiated and before the operator has been terminated.

TD_Evt_SessionThrougput A pointer to a character string containing the information about the SessionThroughput for all the job sessions.
Data in the SessionThroughput for every Session contains the following information:
  • First 4 bytes will contain the database session number.
  • Next 2 bytes will contain Session type.
  • Next 8 bytes will contain CLI average actual send throughput.
  • Next 8 bytes will contain CLI average actual receive throughput.
  • Next 8 bytes will contain CLI average overall send throughput.
  • Next 8 bytes will contain CLI average overall receive throughput.

This event can be queried only after the operator has been initiated and before the operator has been terminated.

TD_Evt_Version A pointer to a character string containing the Teradata PT version followed by a pointer to a character string containing the operator version. Query this event at any time. The operator version is available only after the driver has been initiated.
TD_Evt_MacroNames Returns a block of data for each statement in the DML group. The block of data for each DML statement contains a 4-byte unsigned integer representing the length of the macro name, and n 1-byte characters of the macro name(n is length of macro name).

To return the macro names for the Stream driver, query this event after initiating a connection and before terminating the connection.