Use the show_query() function to show the underlying SQL query of analytic functions.
Example
- Set the option 'val.install.location'.
> options(val.install.location = "VAL")
- 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())
> # <SQL> call VAL.td_analyze('DECISIONTREE', 'database=ALICE; tablename=customer_analysis; > # outputdatabase=ALICE;outputtablename=r__t__valib_td_decision_tree_valib1621181655984242; columns=age,income,nbr_children; dependent=gender; > # algorithm=gainratio; binning=FALSE; max_depth=5; min_records=2; pruning=gainratio');