collect.ts_rdd: Collect data from a TimeSeriesRDD

Description Usage Arguments Value See Also Examples

View source: R/sdf_utils.R

Description

Collect data from a TimeSeriesRDD into a R data frame

Usage

1
2
## S3 method for class 'ts_rdd'
collect(x, ...)

Arguments

x

A com.twosigma.flint.timeseries.TimeSeriesRDD object

...

Additional arguments to 'sdf_collect()'

Value

A R data frame containing the same time series data the input TimeSeriesRDD contains

See Also

Other Spark dataframe utility functions: from_rdd(), from_sdf(), spark_connection.ts_rdd(), spark_dataframe.ts_rdd(), spark_jobj.ts_rdd(), to_sdf(), ts_rdd_builder()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
library(sparklyr)
library(sparklyr.flint)

sc <- try_spark_connect(master = "local")

if (!is.null(sc)) {
  sdf <- copy_to(sc, tibble::tibble(t = seq(10), v = seq(10)))
  ts <- from_sdf(sdf, is_sorted = TRUE, time_unit = "SECONDS", time_column = "t")
  df <- ts %>% collect()
} else {
  message("Unable to establish a Spark connection!")
}

sparklyr.flint documentation built on Jan. 11, 2022, 9:06 a.m.