dbListFields: List Field names of Athena table

Description Usage Arguments Value See Also Examples

Description

List Field names of Athena table

Usage

1
2
## S4 method for signature 'AthenaConnection,character'
dbListFields(conn, name, ...)

Arguments

conn

A DBIConnection object, as returned by dbConnect().

name

a character string with the name of the remote table.

...

Other parameters passed on to methods.

Value

dbListFields() returns a character vector with all the fields from an Athena table.

See Also

dbListFields

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## 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/")
             
# Return list of fields in table
dbListFields(con, "mtcars")

# Disconnect conenction
dbDisconnect(con)

## End(Not run)

RAthena documentation built on Nov. 26, 2021, 5:19 p.m.