spark_collect_data: Collect a Spark DataFrame into R

Description Usage Arguments Value Examples

View source: R/spark_collect_data.R

Description

Given the name of a Spark DataFrame or a reference to a Spark DataFrame, collect it into R from a spark_connection.

Usage

1

Arguments

x

One of:

  • A tbl_spark object.

  • A character(1) name of the table to retrieve passed with sc.

sc

A spark_connection, only required if x is passed as a character(1) (def: NULL).

Value

A tibble.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
sc <- sparklyr::spark_connect(master = "local")
mtcars_spark <- dplyr::copy_to(sc, mtcars)

# We can collect the data using the R objet
spark_collect_data(mtcars_spark)

# Or by referencing the name within the spark connection
spark_collect_data(x = "mtcars", sc = sc)

## End(Not run)

nathaneastwood/sparklio documentation built on March 16, 2021, 7:51 p.m.