Learn R Programming

RPresto (version 1.4.8)

PrestoConnection-class: S4 implementation of DBIConnection for Presto.

Description

S4 implementation of DBIConnection for Presto.

Get column type information for a Presto table

Usage

# S4 method for PrestoConnection
show(object)

# S4 method for PrestoConnection,ANY,data.frame dbAppendTable(conn, name, value, ..., chunk.fields = NULL, row.names = NULL)

# S4 method for PrestoConnection dbAppendTableAs(conn, name, sql, auto_reorder = TRUE, ...)

dbColumnType(conn, name, ...)

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

# S4 method for PrestoConnection,dbplyr_schema dbColumnType(conn, name, ...)

# S4 method for PrestoConnection,Id dbColumnType(conn, name, ...)

# S4 method for PrestoConnection,SQL dbColumnType(conn, name, ...)

# 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,ANY 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,dbplyr_schema dbListFields(conn, name, ...)

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

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

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

# S4 method for PrestoConnection,dbplyr_schema dbQuoteIdentifier(conn, x, ...)

# S4 method for PrestoConnection,dbplyr_table_path dbQuoteIdentifier(conn, x, ...)

# S4 method for PrestoConnection,AsIs dbQuoteIdentifier(conn, x, ...)

# S4 method for PrestoConnection dbQuoteLiteral(conn, x, ...)

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

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

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

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

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

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

# S4 method for PrestoConnection dbRenameTable(conn, name, new_name, ...)

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

# S4 method for PrestoConnection,ANY,data.frame dbWriteTable( conn, name, value, overwrite = FALSE, ..., append = FALSE, field.types = NULL, temporary = FALSE, row.names = FALSE, with = NULL, chunk.fields = NULL, use.one.query = FALSE )

# S4 method for PrestoConnection sqlAppendTableAs(con, name, sql, auto_reorder = TRUE, ...)

# 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, ...)

Value

A data frame with columns:

  • name: Column name (character)

  • type: R type (character)

  • .presto_type: Presto type as string (character)

Arguments

conn

a PrestoConnection object, as returned by DBI::dbConnect().

name

A table name (character, Id, SQL, or dbplyr_schema)

value

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

...

Additional arguments (not currently used)

chunk.fields

A character vector of names of the fields that should be used to slice the value data frame into chunks for batch append. This is necessary when the data frame is too big to be uploaded at once in one single INSERT INTO statement. Default to NULL which inserts the entire value data frame.

row.names

Must be NULL.

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.

temporary

If TRUE, will generate a temporary table.

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%'

x

A character vector, SQL or Id object to quote as identifier.

fail_if_missing

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

use.one.query

A boolean to indicate if to use a single CREATE TABLE AS statement rather than the default implementation of using separate CREATE TABLE and INSERT INTO statements. Some Presto backends might have different requirements between the two approaches. e.g. INSERT INTO might not be allowed to mutate an unpartitioned table created by CREATE TABLE. If set to TRUE, chunk.fields cannot be used.

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"')