ConvertTo
Description
The td_convert_to_sqle()
function converts the specified input tbl_teradata columns to
specified data types.
Usage
td_convert_to_sqle (
data = NULL,
target.columns = NULL,
target.datatype = NULL,
accumulate = NULL,
...
)
Arguments
data |
Required Argument. |
target.columns |
Required Argument. |
target.datatype |
Required Argument. |
accumulate |
Optional Argument. |
... |
Specifies the generic keyword arguments SQLE functions accept. Below persist: volatile: Function allows the user to partition, hash, order or local order the input data. These generic arguments are available for each argument that accepts tbl_teradata as input and can be accessed as:
Note: |
Value
Function returns an object of class "td_convert_to_sqle"
which is a named list containing object of class "tbl_teradata".
Named list member(s) can be referenced directly with the "$" operator
using the name(s):result
Examples
# Get the current context/connection.
con <- td_get_context()$connection
# Load the example data.
loadExampleData("tdplyr_example", "titanic")
# Create tbl_teradata object.
titanic <- tbl(con, "titanic")
# Check the list of available analytic functions.
display_analytic_functions()
# Example 1 : Convert datatype of 'fare' to integer.
convertto_out <- td_convert_to_sqle(data = titanic,
target.columns = c("fare"),
target.datatype = c("integer"),
accumulate=c('passenger', 'name', 'ticket')
)
# Print the result.
print(convertto_out$result)