Learn R Programming

RPresto (version 1.4.8)

presto_type: Get column type information for a Presto table or query

Description

Returns column type information for a tbl_presto object, including Presto types for complex and nested types.

Usage

presto_type(data, ...)

# S3 method for tbl_presto presto_type(data, ...)

Value

A data frame with columns:

  • name: Column name (character)

  • type: R type (character)

  • .presto_type: Presto type as string (character)

Arguments

data

A tbl_presto object

...

Additional arguments (currently unused)

Examples

Run this code
if (FALSE) {
# Connect to Presto
con <- DBI::dbConnect(RPresto::Presto(), ...)

# Get column types for a table
tbl(con, "my_table") %>%
  presto_type()

# Get column types for a query
tbl(con, "my_table") %>%
  dplyr::filter(id > 100) %>%
  presto_type()
}

Run the code above in your browser using DataLab