InsertRedshiftTableByQuery: Creates a table with the results of a given SQL query

Description Arguments Value Author(s)

Description

Given a SQL query, this functions inserts it's results onto a redshift table. We can choose to clean the existing table records before inserting or to simply append. If the table does not exist, one will be automatically created. The yaml file must contain host, dbname, user and password.

Arguments

query

Character vector with length 1. Can be either a SQL query or a path to a text file containing a SQL query.

tableName

The name of the redshift table to create or append to. Will be transformed to lower case.

schema

Character vector with length 1 with the name of the DB schema were the table will be created.

keyColumn

Optional. A character string or a character vector with the name of a column/columns to be used as sort keys in the newly created table. If nothing is specified, the table is created without sort keys.

clean

Boolean indicating whether or not to remove existing records from the table before inserting.

id

The name of the yaml group containing the database credentials.

yamlFile

The path to the yaml file.

Value

The function will return a boolean value indicating if the process completed successfully.

Author(s)

João Monteiro and Daniela Cunha


rvladimiro/dafR documentation built on June 26, 2019, 4:37 a.m.