redshift_query: Query an FT Redshift cluster.

Description Usage Arguments Value Examples

View source: R/redshift_query.R

Description

redshift_query returns the output of a SQL query on one of the FT Redshift clusters. You must be connected to the FT internal network to use this function. If you are commiting code to github, do not write your redshift user name and password into the file. Instead create a .Renviron file in your home directory and access the credentials via Sys.getEnv() (see examples).

Usage

1
redshift_query(sql_file, cluster, username, password, from_file = TRUE)

Arguments

sql_file

File name (and path) of a .sql you would like to run.

cluster

The name of the cluster on which the query should run. Use 'int' for the INT cluster and 'analytics' for the Analytics cluster.

username

Your Redshift username.

password

Your Redshift passowrd.

from_file

Is the sql_file field a file to be ready or a query as a string? To pass a query string set to FALSE.

Value

A dataframe of the query output.

Examples

1
2
3
4
## Not run: 
redshift_query("my_query.sql","int",Sys.getEnv("redshift_username"),Sys.getEnv("redshift_password"))

## End(Not run)

Financial-Times/ftRtools documentation built on Oct. 29, 2021, 9:59 a.m.