td_test_script() | Teradata R Package - 17.00 - td_test_script() - Teradata R Package

Teradata® R Package User Guide

prodname
Teradata R Package
vrm_release
17.00
created_date
November 2020
category
User Guide
featnum
B700-4005-090K

The td_test_script() function enables a user to run script in Docker container environment outside Vantage. Input data for user script is read from file or Vantage.

quotechar functionality is not supported in td_test_script() function.

Example 1: Test user script using the data from CSV file

This example tests the user script mentioned in the argument "script.name" using the data provided in the argument "input.data.file".

> td_test_script(object = script_obj,
                 files.local.path = file.path(tdplyr_install_location, "scripts"),
                 script.name = "mapper.R",
                 input.data.file = "barrier.csv"
  )
       word count_input
1       Old           1
2 Macdonald           1
3       Had           1
4         A           1
5      Farm           1

Example 2: Test user script using data from Vantage

This example tests the user script mentioned in the argument "script.name" using the data from AMPs in the database.

> td_test_script(object = script_obj,
                 files.local.path = file.path(tdplyr_install_location, "scripts"),
                 script.name = "mapper.R",
                 password = <password>
  )
       word count_input
1       Old           1
2 Macdonald           1
3       Had           1
4         A           1
5      Farm           1