Learn R Programming

RAthena (version 2.0.0)

RAthena_options: A method to configure RAthena backend options.

Description

RAthena_options() provides a method to change the backend. This includes changing the file parser, whether RAthena should cache query ids locally and number of retries on a failed api call.

Usage

RAthena_options(
  file_parser = c("data.table", "vroom"),
  bigint = NULL,
  binary = NULL,
  json = NULL,
  cache_size = 0,
  clear_cache = FALSE,
  retry = 5,
  retry_quiet = FALSE
)

Arguments

file_parser

Method to read and write tables to Athena, currently defaults to data.table. The file_parser also determines the data format returned for example data.table will return data.table and vroom will return tibble.

bigint

The R type that 64-bit integer types should be mapped to. Default NULL won't make any changes that dbConnect has set. Inbuilt bigint conversion types ["integer64", "integer", "numeric", "character"].

binary

The R type that [binary/varbinary] types should be mapped to. Default NULL won't make any changes that dbConnect has set. Inbuilt binary conversion types ["raw", "character"].

json

Attempt to converts AWS Athena data types [arrays, json] using jsonlite:parse_json. Default NULL won't make any changes that dbConnect has set. Inbuilt json conversion types ["auto", "character"]. Custom Json parsers can be provide by using a function with data frame parameter.

cache_size

Number of queries to be cached. Currently only support caching up to 100 distinct queries.

clear_cache

Clears all previous cached query metadata

retry

Maximum number of requests to attempt.

retry_quiet

If FALSE, will print a message from retry displaying how long until the next request.

Value

RAthena_options() returns NULL, invisibly.

Examples

Run this code
# NOT RUN {
library(RAthena)

# change file parser from default data.table to vroom
RAthena_options("vroom")

# cache queries locally
RAthena_options(cache_size = 5)
# }

Run the code above in your browser using DataLab