td_fastexport function extracts data from Teradata Vantage
using FastExport protocol.
The function cannot be used to extract data from a volatile or global temporary table.
Do not use the function to fetch only a few rows, because it opens extra connections to the database, which is time consuming.
Only use this function to fetch many rows (at least 100,000 rows) so that the row-fetching performance gain exceeds the overhead of opening additional connections.
The function does not support all Teradata Database data types. For example, BLOB and CLOB are not supported.
For best results, do not use
The result set ordering behavior with
td_fastexportmay differ from the ordering without
td_fastexport. In particular, an object of class "tbl_teradata" containing an ordered analytic function may not produce an ordered result set. Use
arrangeto guarantee result set order.
For additional information about fastexport protocol through teradatasql driver, please refer the FastExport section of terdatasql driver documentation.
td_fastexport(df, catch.errors.warnings = TRUE, ...)
Specifies additional arguments required for future enhancements.
Function returns an object of class "FastExport" which is a
named list containing the following objects:
result : A R dataframe containing the data.
errors (only if "catch.errors.warnings" is set to TRUE):
If there are no errors, this contains NULL.
If there are errors, this contains a R dataframe containing the errors raised by fastexport protocol.
warnings (only if "catch.errors.warnings" is set to TRUE):
If there are no warnings, this contains NULL.
If there are errors, this contains a R dataframe containing the warnings raised by fastexport protocol.
Named list member can be referenced directly with the "$" operator.
# Note: Connection must be established before running td_fastexport(). # Load the required tables. loadExampleData("time_series_example", "ocean_buoys_seq") # Create object(s) of class "tbl_teradata". df_seq <- tbl(con, "ocean_buoys_seq") # Example 1: Extract the data along with the errors and warnings, if any, # while fetching the data. val <- td_fastexport(df = df_seq) # Print 10 rows of the fetched dataframe. head(val$result, 10) # Print the errors dataframe; NULL if there are no errors. val$errors # Print the warnings dataframe; NULL if there are no warnings. val$warnings # Example 2: Extract the data without errors and warnings. val <- td_fastexport(df = df_seq, catch.errors.warnings = FALSE) # Print the "FastExport" object. print(val)