Skip to contents

S4 implementation of DBIConnection for Presto.

Usage

# S4 method for PrestoConnection
show(object)

# S4 method for PrestoConnection
dbCreateTable(
  conn,
  name,
  fields,
  with = NULL,
  ...,
  row.names = NULL,
  temporary = FALSE
)

# S4 method for PrestoConnection
dbCreateTableAs(conn, name, sql, overwrite = FALSE, with = NULL, ...)

# S4 method for PrestoConnection,character
dbExistsTable(conn, name, ...)

# S4 method for PrestoConnection,character
dbGetQuery(conn, statement, ..., quiet = getOption("rpresto.quiet"))

# S4 method for PrestoConnection,character
dbListFields(conn, name, ...)

# S4 method for PrestoConnection
dbListTables(conn, pattern, ...)

# S4 method for PrestoConnection,character
dbReadTable(conn, name, ...)

# S4 method for PrestoConnection,character
dbRemoveTable(conn, name, ..., fail_if_missing = TRUE)

# S4 method for PrestoConnection,character
dbSendQuery(conn, statement, ..., quiet = getOption("rpresto.quiet"))

# S4 method for PrestoConnection,character,data.frame
dbWriteTable(
  conn,
  name,
  value,
  overwrite = FALSE,
  ...,
  append = FALSE,
  field.types = NULL,
  temporary = FALSE,
  row.names = FALSE,
  with = NULL
)

# S4 method for PrestoConnection
sqlCreateTable(
  con,
  table,
  fields,
  row.names = NA,
  temporary = FALSE,
  with = NULL,
  ...
)

# S4 method for PrestoConnection
sqlCreateTableAs(con, name, sql, with = NULL, ...)

Arguments

conn

A DBIConnection object, as returned by dbConnect().

name

The table name, passed on to dbQuoteIdentifier(). Options are:

  • a character string with the unquoted DBMS table name, e.g. "table_name",

  • a call to Id() with components to the fully qualified table name, e.g. Id(schema = "my_schema", table = "table_name")

  • a call to SQL() with the quoted and fully qualified table name given verbatim, e.g. SQL('"my_schema"."table_name"')

fields

Either a character vector or a data frame.

A named character vector: Names are column names, values are types. Names are escaped with dbQuoteIdentifier(). Field types are unescaped.

A data frame: field types are generated using dbDataType().

with

An optional WITH clause for the CREATE TABLE statement.

...

Other parameters passed on to methods.

overwrite

a logical specifying whether to overwrite an existing table or not. Its default is FALSE.

quiet

If a progress bar should be shown for long queries (which run for more than 2 seconds. Default to getOption("rpresto.quiet") which if not set, defaults to NA which turns on the progress bar for interactive queries.

pattern

optional SQL pattern for filtering table names, e.g. '%test%'

fail_if_missing

If FALSE, dbRemoveTable() succeeds if the table doesn't exist.

value

a data.frame (or coercible to data.frame).

append, field.types, temporary, row.names

Ignored. Included for compatibility with generic.

con

A database connection.

table

The table name, passed on to dbQuoteIdentifier(). Options are:

  • a character string with the unquoted DBMS table name, e.g. "table_name",

  • a call to Id() with components to the fully qualified table name, e.g. Id(schema = "my_schema", table = "table_name")

  • a call to SQL() with the quoted and fully qualified table name given verbatim, e.g. SQL('"my_schema"."table_name"')