Get SQL query
Description
Function to return the underlying SQL query.
Usage
## S3 method for class 'td_analytics_valib'
show_query(obj)
Arguments
obj |
Required Argument. |
Examples
# Notes:
# 1. To execute Vantage Analytic Library functions, set option 'val.install.location' to
# the database name where Vantage analytic library functions are installed.
# 2. Datasets used in these examples can be loaded using Vantage Analytic
# Library installer.
# Set the option 'val.install.location'.
options(val.install.location = "SYSLIB")
# Get remote data source connection.
con <- td_get_context()$connection
# Create an object of class "tbl_teradata".
df <- tbl(con, "customer_analysis")
print(df)
# Run td_decision_tree_valib() on columns "age", "income" and "nbr_children", with
# dependent variable "gender".
obj <- td_decision_tree_valib(data=df,
columns=c("age", "income", "nbr_children"),
response.column="gender",
algorithm="gainratio",
binning=FALSE,
max.depth=5,
num.splits=2,
pruning="gainratio")
# Print the SQL query.
print(obj %>% show_query())