spark_execute_td_presto: Read Treasure Data data from Presto via api-presto gateway

Description Usage Arguments Details See Also Examples

View source: R/td_query.R

Description

Read Treasure Data data from Presto via api-presto gateway

Usage

1

Arguments

sc

A spark_connection.

source

Data base name of the table on TD. Example: "sample_datasets"

query

A SQL to execute

options

A list of strings with additional options.

Details

You can execute queries to TD through td-spark. You have to set spark.td.apikey, spark.serializer appropreately.

See Also

Other Spark serialization routines: spark_read_td_presto, spark_read_td_query, spark_read_td, spark_write_td

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 
library(dplyr)
config <- spark_config()

config$spark.td.apikey <- Sys.getenv("TD_API_KEY")
config$spark.serializer <- "org.apache.spark.serializer.KryoSerializer"
config$spark.sql.execution.arrow.enabled <- "true"

sc <- spark_connect(master = "local", config = config)

spark_execute_td_presto(sc,
  "sample_datasets",
  "create table if not exists orders (key bigint, status varchar, price double)")

## End(Not run)

chezou/sparklytd documentation built on Oct. 27, 2019, 2:32 a.m.