tdr.TblRead Function | R Table Operators | Teradata Vantage - tdr.TblRead - Analytics Database - Teradata Vantage

SQL External Routine Programming

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
2023-07-11
dita:mapPath
iiv1628111441820.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
B035-1147
lifecycle
latest
Product Category
Teradata Vantageā„¢

Reads an input stream into an R data frame and returns the data frame.

If there are no more rows in the stream, the function returns an empty data frame.

If an error occurs, the function returns one of the following error codes:

Error Code Error Condition
-2 The table operator aborted.
-3 The input parameter has an invalid type.
-4 The input parameter has an invalid value.
-5 This function was called from the contract function.

Syntax

tdr.TblRead(  handle,  dataframesize  )

Syntax Elements

handle
Parameter type: raw vector

The handle of the input stream returned by the tdr.Open function.

dataframesize
Parameter type: integer

The maximum size (in bytes) of the data frame that is generated. This size is limited by the UDFmalloc size of the secure server which is 32MB by default.

If you set this parameter to 0, the available size is divided equally between the input and output streams.

Usage Notes

Before you call this function, you must call the tdr.Open function to open the input stream. Then pass the handle returned from tdr.Open as an argument to this function.

Based on the memory resource available, the data frame size returned may be less than the size specified in the call to tdr.TblRead.

This function is valid only if called from the table operator.

The following data types are not supported in data frames:
  • DECIMAL8
  • DECIMAL16
  • TIME
  • TIME_WTZ
  • TIMESTAMP
  • TIMESTAMP_WTZ
  • INTERVAL_YTM
  • INTERVALH
  • INTERVALM
  • INTERVALS
  • INTERVAL_HTM
  • INTERVAL_HTS
  • INTERVAL_MTS
  • INTERVAL_SECOND
If you want to use these data types in data frames, you must cast them to a supported type.

The data frame has the maximum number of rows that can fit in allocated memory. The data frame is created by mapping Teradata data types to R data types. See Mapping Between Teradata Data Types and R Types.