athena_connect: Simplified Athena JDBC connection helper

Description Usage Arguments References Examples

View source: R/metis.r

Description

Handles the up-front JDBC config

Usage

1
2
3
4
5
6
7
athena_connect(default_schema = "default",
  provider = "com.simba.athena.amazonaws.auth.DefaultAWSCredentialsProviderChain",
  region = c("us-east-1", "us-east-2", "us-west-2"),
  s3_staging_dir = Sys.getenv("AWS_S3_STAGING_DIR"),
  max_error_retries = 10, connection_timeout = 10000,
  socket_timeout = 10000, log_path = "", log_level = c("OFF",
  "FATAL", "ERROR", "WARNING", "INFO", "DEBUG", "TRACE"), ...)

Arguments

default_schema

the name of the database schema to use when a schema is not explicitly specified in a query. You can still issue queries on other schemas by explicitly specifying the schema in the query.

provider

JDBC auth provider (defaults to com.simba.athena.amazonaws.auth.DefaultAWSCredentialsProviderChain)

region

AWS region (Ref: http://docs.aws.amazon.com/general/latest/gr/rande.html#athena)

s3_staging_dir

the Amazon S3 location to which your query output is written. The JDBC driver then asks Athena to read the results and provide rows of data back to the user.

max_error_retries

the maximum number of retries that the JDBC client attempts to make a request to Athena.

connection_timeout

the maximum amount of time, in milliseconds, to make a successful connection to Athena before an attempt is terminated.

socket_timeout

the maximum amount of time, in milliseconds, to wait for a socket in order to send data to Athena.

log_path

local path of the Athena JDBC driver logs. If no log path is provided, then no log files are created.

log_level

log level of the Athena JDBC driver logs. Use names "OFF", "FATAL", "ERROR", "WARNING", "INFO", "DEBUG", "TRACE".

...

passed on to the driver

References

Connect with JDBC; Simba Athena JDBC Driver with SQL Connector Installation and Configuration Guide

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Not run: 
use_credentials("personal")

athena_connect(
  default_schema = "sampledb",
  s3_staging_dir = "s3://accessible-bucket",
  log_path = "/tmp/athena.log",
  log_level = "DEBUG"
) -> ath

dbListTables(ath)

dbGetQuery(ath, "SELECT * FROM sampledb.elb_logs LIMIT 1")


## End(Not run)

hrbrmstr/metis documentation built on May 23, 2019, 8:37 a.m.