Learn R Programming

RAthena (version 1.5.0)

dbRemoveTable: Remove table from Athena

Description

Removes Athena table but does not remove the data from Amazon S3 bucket.

Usage

# S4 method for AthenaConnection,character
dbRemoveTable(conn, name, ...)

Arguments

conn

A '>DBIConnection object, as returned by dbConnect().

name

A character string specifying a DBMS table name.

...

Other parameters passed on to methods.

Value

dbRemoveTable() returns TRUE, invisibly.

See Also

dbRemoveTable

Examples

Run this code
# NOT RUN {
# 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())

# 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)
# }

Run the code above in your browser using DataLab