Script() | Teradata R Package - 17.00 - 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 Script() function constructs a ScriptTableOperator object that can be used to run a user-installed script or any Linux command inside database on Vantage or in the sandbox environment.

The following example creates a ScriptTableOperator object that allows users to execute user script in Vantage.
> script_obj <- Script(data = barrier %>% select(Name),
                       script.command = script_command,
                       returns = list("word"= "VARCHAR(15)", "count_input"= "VARCHAR(2)"),
                       data.order.column = "Name"
  )
> script_obj
$script.command
[1] "Rscript ./TDAPUSERDB/mapper.R"
$returns
$returns$word
[1] "VARCHAR(15)"
$returns$count_input
[1] "VARCHAR(2)"
$data
# Source:   lazy query [?? x 1]
# Database: [Teradata 16.20.27.01] [Teradata Native Driver 17.0.0.4]
#   [TDAPUSER@<hostname>1025/TDAPUSERDB]
  Name                   
  <chr>                  
1 Old Macdonald Had A Farm
$data.hash.column
NULL
$data.partition.column
NULL
$data.order.column
[1] "Name"
$is.local.order
[1] FALSE
$sort.ascending
[1] TRUE
$nulls.first
[1] TRUE
$delimiter
[1] "\t"
$auth
NULL
$charset
[1] "LATIN"
$quotechar
NULL
attr(,"class")
[1] "ScriptTableOperator"