tbl2darray: Converts a dplyr tbl object to a darray in Distributed R.

Description Usage Arguments Value Examples

Description

This requires distributedR and HPData and will attempt to load them. If Distributed R is not already running, it will start it. Internally, this function simply saves the tbl reference as a view in Vertica and then uses the Vertica Loader to move data into Distributed R, and then deletes the view from database. Note that if you do not use the Vertica Native Data Loader, your table must have a 'rowid' column for this to work (see ?HPdata::db2darray for more information).

Usage

1
2
tbl2darray(table, dsn, features, npartitions, verticaConnector = TRUE,
  loadPolicy = "local")

Arguments

table

The local R-variable name of the tbl_vertica object to be converted to a darray.

dsn

The name of the DSN as specified in the ODBC.INI file. If an ODBC connection is already active, then the DSN of that connection will be used. If not (JDBC is being used), this field will be required.

features

Names of the columns to convert into the darray, provided as a list.

npartitions

this optional argument specifies the desired number of splits (partitions) in the dobject.

verticaConnector

TRUE to use the Vertica Connector for Distributed R. If FALSE, your table must include a 'rowid' column. See the manual page for HPdata::db2darray for more information.

loadPolicy

"local" or "uniform". Please see help doc for db2darray in package HPdata. Please read the details for more information.

Value

A new darray object

Examples

1
2
3
4
5
6
7
## Not run: 
vertica <- src_vertica("VerticaDSN")
table1 <- tbl(vertica,"some_table")
table1_modified <- filter(table1,foo > 3)
my_darray <- tbl2darray(table1_modified,features=list("some_column"))

## End(Not run)

vertica/vertica.dplyr documentation built on May 3, 2019, 6:11 p.m.