if (FALSE) {
# Note:
# - Require AWS Account to run below example.
# - Different connection methods can be used please see `RAthena::dbConnect` documnentation
library(DBI)
# Demo connection to Athena using profile name
con <- dbConnect(RAthena::athena())
# Create DDL for iris data.frame
sqlCreateTable(con, "iris", iris, s3.location = "s3://path/to/athena/table")
# Create DDL for iris data.frame with partition
sqlCreateTable(con, "iris", iris,
partition = "timestamp",
s3.location = "s3://path/to/athena/table")
# Create DDL for iris data.frame with partition and file.type parquet
sqlCreateTable(con, "iris", iris,
partition = "timestamp",
s3.location = "s3://path/to/athena/table",
file.type = "parquet")
# Disconnect from Athena
dbDisconnect(con)
}
Run the code above in your browser using DataLab