These functions are used to build the different types of SQL queries. The AWS Athena implementation give extra parameters to allow access the to standard DBI Athena methods. They also utilise AWS Glue to speed up sql query execution.

db_save_query.AthenaConnection(
  con,
  sql,
  name,
  file_type = c("NULL", "csv", "tsv", "parquet", "json", "orc"),
  s3_location = NULL,
  partition = NULL,
  compress = TRUE,
  ...
)

db_explain.AthenaConnection(con, sql, ...)

db_query_fields.AthenaConnection(con, sql, ...)

sql_escape_date.AthenaConnection(con, x)

sql_escape_datetime.AthenaConnection(con, x)

Arguments

con

A dbConnect object, as returned by dbConnect()

sql

SQL code to be sent to AWS Athena

name

Table name if left default RAthena will use default from 'dplyr''s compute function.

file_type

What file type to store data.frame on s3, RAthena currently supports ["NULL","csv", "tsv", "parquet", "json", "orc"]. "NULL" will let Athena set the file_type for you.

s3_location

s3 bucket to store Athena table, must be set as a s3 uri for example ("s3://mybucket/data/")

partition

Partition Athena table, requires to be a partitioned variable from previous table.

compress

Compress Athena table, currently can only compress ["parquet", "orc"] AWS Athena CTAS

...

other parameters, currently not implemented

x

R object to be transformed into athena equivalent

Value

db_save_query

Returns table name

db_explain

Raises an error as AWS Athena does not support EXPLAIN queries Athena Limitations

db_query_fields

Returns sql query column names