dbGetPartition: Athena table partitions

Description Usage Arguments Value Examples

Description

This method returns all partitions from Athena table.

Usage

1
2
3
4
dbGetPartition(conn, name, ..., .format = FALSE)

## S4 method for signature 'AthenaConnection'
dbGetPartition(conn, name, ..., .format = FALSE)

Arguments

conn

A DBIConnection object, as returned by dbConnect().

name

A character string specifying a DBMS table name.

...

Other parameters passed on to methods.

.format

re-formats AWS Athena partitions format. So that each column represents a partition from the AWS Athena table. Default set to FALSE to prevent breaking previous package behaviour.

Value

data.frame that returns all partitions in table, if no partitions in Athena table then function will return error from Athena.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
## 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 iris table to Athena                  
dbWriteTable(con, "iris",
             iris,
             partition = c("timestamp" = format(Sys.Date(), "%Y%m%d")),
             s3.location = "s3://path/to/store/athena/table/")

# return table partitions
noctua::dbGetPartition(con, "iris")

# disconnect from Athena
dbDisconnect(con)

## End(Not run)

noctua documentation built on Sept. 23, 2021, 5:12 p.m.