dbRemoveTable | R Documentation |
Removes Athena table but does not remove the data from Amazon S3 bucket.
## S4 method for signature 'AthenaConnection,character'
dbRemoveTable(conn, name, delete_data = TRUE, confirm = FALSE, ...)
## S4 method for signature 'AthenaConnection,Id'
dbRemoveTable(conn, name, delete_data = TRUE, confirm = FALSE, ...)
conn |
A DBIConnection object, as returned by
|
name |
The table name, passed on to
|
delete_data |
Deletes S3 files linking to AWS Athena table |
confirm |
Allows for S3 files to be deleted without the prompt check. It is recommend to leave this set to |
... |
Other parameters passed on to methods. |
dbRemoveTable()
returns TRUE
, invisibly.
If you are having difficulty removing AWS S3 files please check if the AWS S3 location following AWS best practises: Table Location in Amazon S3
dbRemoveTable
## Not run:
# Note:
# - Require AWS Account to run below example.
# - Different connection methods can be used please see `noctua::dbConnect` documnentation
library(DBI)
# Demo connection to Athena using profile name
con <- dbConnect(noctua::athena())
# Write data.frame to Athena table
dbWriteTable(con, "mtcars", mtcars,
partition = c("TIMESTAMP" = format(Sys.Date(), "%Y%m%d")),
s3.location = "s3://mybucket/data/"
)
# Remove Table from Athena
dbRemoveTable(con, "mtcars")
# Disconnect conenction
dbDisconnect(con)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.