sparklyr v0.6.3

0

Monthly downloads

0th

Percentile

R Interface to Apache Spark

R interface to Apache Spark, a fast and general engine for big data processing, see <http://spark.apache.org>. This package supports connecting to local and remote Apache Spark clusters, provides a 'dplyr' compatible back-end, and provides an interface to Spark's built-in machine learning algorithms.

Readme

sparklyr: R interface for Apache Spark

Build Status CRAN\_Status\_Badge codecov Join the chat at https://gitter.im/rstudio/sparklyr

  • Connect to Spark from R. The sparklyr package provides a
    complete dplyr backend.
  • Filter and aggregate Spark datasets then bring them into R for
    analysis and visualization.
  • Use Spark's distributed machine learning library from R.
  • Create extensions that call the full Spark API and provide
    interfaces to Spark packages.

Installation

You can install the sparklyr package from CRAN as follows:

install.packages("sparklyr")

You should also install a local version of Spark for development purposes:

library(sparklyr)
spark_install(version = "2.1.0")

To upgrade to the latest version of sparklyr, run the following command and restart your r session:

devtools::install_github("rstudio/sparklyr")

If you use the RStudio IDE, you should also download the latest preview release of the IDE which includes several enhancements for interacting with Spark (see the RStudio IDE section below for more details).

Connecting to Spark

You can connect to both local instances of Spark as well as remote Spark clusters. Here we'll connect to a local instance of Spark via the spark_connect function:

library(sparklyr)
sc <- spark_connect(master = "local")

The returned Spark connection (sc) provides a remote dplyr data source to the Spark cluster.

For more information on connecting to remote Spark clusters see the Deployment section of the sparklyr website.

Using dplyr

We can now use all of the available dplyr verbs against the tables within the cluster.

We'll start by copying some datasets from R into the Spark cluster (note that you may need to install the nycflights13 and Lahman packages in order to execute this code):

install.packages(c("nycflights13", "Lahman"))
library(dplyr)
iris_tbl <- copy_to(sc, iris)
flights_tbl <- copy_to(sc, nycflights13::flights, "flights")
batting_tbl <- copy_to(sc, Lahman::Batting, "batting")
src_tbls(sc)
## [1] "batting" "flights" "iris"

To start with here's a simple filtering example:

# filter by departure delay and print the first few records
flights_tbl %>% filter(dep_delay == 2)
## # Source:   lazy query [?? x 19]
## # Database: spark_connection
##     year month   day dep_time sched_dep_time dep_delay arr_time
##    <int> <int> <int>    <int>          <int>     <dbl>    <int>
##  1  2013     1     1      517            515         2      830
##  2  2013     1     1      542            540         2      923
##  3  2013     1     1      702            700         2     1058
##  4  2013     1     1      715            713         2      911
##  5  2013     1     1      752            750         2     1025
##  6  2013     1     1      917            915         2     1206
##  7  2013     1     1      932            930         2     1219
##  8  2013     1     1     1028           1026         2     1350
##  9  2013     1     1     1042           1040         2     1325
## 10  2013     1     1     1231           1229         2     1523
## # ... with more rows, and 12 more variables: sched_arr_time <int>,
## #   arr_delay <dbl>, carrier <chr>, flight <int>, tailnum <chr>,
## #   origin <chr>, dest <chr>, air_time <dbl>, distance <dbl>, hour <dbl>,
## #   minute <dbl>, time_hour <dbl>

Introduction to dplyr provides additional dplyr examples you can try. For example, consider the last example from the tutorial which plots data on flight delays:

delay <- flights_tbl %>% 
  group_by(tailnum) %>%
  summarise(count = n(), dist = mean(distance), delay = mean(arr_delay)) %>%
  filter(count > 20, dist < 2000, !is.na(delay)) %>%
  collect

# plot delays
library(ggplot2)
ggplot(delay, aes(dist, delay)) +
  geom_point(aes(size = count), alpha = 1/2) +
  geom_smooth() +
  scale_size_area(max_size = 2)
## `geom_smooth()` using method = 'gam'

Window Functions

dplyr window functions are also supported, for example:

batting_tbl %>%
  select(playerID, yearID, teamID, G, AB:H) %>%
  arrange(playerID, yearID, teamID) %>%
  group_by(playerID) %>%
  filter(min_rank(desc(H)) <= 2 & H > 0)
## # Source:     lazy query [?? x 7]
## # Database:   spark_connection
## # Groups:     playerID
## # Ordered by: playerID, yearID, teamID
##     playerID yearID teamID     G    AB     R     H
##        <chr>  <int>  <chr> <int> <int> <int> <int>
##  1 aaronha01   1959    ML1   154   629   116   223
##  2 aaronha01   1963    ML1   161   631   121   201
##  3 abbotji01   1999    MIL    20    21     0     2
##  4 abnersh01   1992    CHA    97   208    21    58
##  5 abnersh01   1990    SDN    91   184    17    45
##  6 acklefr01   1963    CHA     2     5     0     1
##  7 acklefr01   1964    CHA     3     1     0     1
##  8 adamecr01   2016    COL   121   225    25    49
##  9 adamecr01   2015    COL    26    53     4    13
## 10 adamsac01   1943    NY1    70    32     3     4
## # ... with more rows

For additional documentation on using dplyr with Spark see the dplyr section of the sparklyr website.

Using SQL

It's also possible to execute SQL queries directly against tables within a Spark cluster. The spark_connection object implements a DBI interface for Spark, so you can use dbGetQuery to execute SQL and return the result as an R data frame:

library(DBI)
iris_preview <- dbGetQuery(sc, "SELECT * FROM iris LIMIT 10")
iris_preview
##    Sepal_Length Sepal_Width Petal_Length Petal_Width Species
## 1           5.1         3.5          1.4         0.2  setosa
## 2           4.9         3.0          1.4         0.2  setosa
## 3           4.7         3.2          1.3         0.2  setosa
## 4           4.6         3.1          1.5         0.2  setosa
## 5           5.0         3.6          1.4         0.2  setosa
## 6           5.4         3.9          1.7         0.4  setosa
## 7           4.6         3.4          1.4         0.3  setosa
## 8           5.0         3.4          1.5         0.2  setosa
## 9           4.4         2.9          1.4         0.2  setosa
## 10          4.9         3.1          1.5         0.1  setosa

Machine Learning

You can orchestrate machine learning algorithms in a Spark cluster via the machine learning functions within sparklyr. These functions connect to a set of high-level APIs built on top of DataFrames that help you create and tune machine learning workflows.

Here's an example where we use ml_linear_regression to fit a linear regression model. We'll use the built-in mtcars dataset, and see if we can predict a car's fuel consumption (mpg) based on its weight (wt), and the number of cylinders the engine contains (cyl). We'll assume in each case that the relationship between mpg and each of our features is linear.

# copy mtcars into spark
mtcars_tbl <- copy_to(sc, mtcars)

# transform our data set, and then partition into 'training', 'test'
partitions <- mtcars_tbl %>%
  filter(hp >= 100) %>%
  mutate(cyl8 = cyl == 8) %>%
  sdf_partition(training = 0.5, test = 0.5, seed = 1099)

# fit a linear model to the training dataset
fit <- partitions$training %>%
  ml_linear_regression(response = "mpg", features = c("wt", "cyl"))
## * No rows dropped by 'na.omit' call
fit
## Call: ml_linear_regression(., response = "mpg", features = c("wt", "cyl"))
## 
## Coefficients:
## (Intercept)          wt         cyl 
##   33.499452   -2.818463   -0.923187

For linear regression models produced by Spark, we can use summary() to learn a bit more about the quality of our fit, and the statistical significance of each of our predictors.

summary(fit)
## Call: ml_linear_regression(., response = "mpg", features = c("wt", "cyl"))
## 
## Deviance Residuals::
##    Min     1Q Median     3Q    Max 
## -1.752 -1.134 -0.499  1.296  2.282 
## 
## Coefficients:
##             Estimate Std. Error t value  Pr(>|t|)    
## (Intercept) 33.49945    3.62256  9.2475 0.0002485 ***
## wt          -2.81846    0.96619 -2.9171 0.0331257 *  
## cyl         -0.92319    0.54639 -1.6896 0.1518998    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## R-Squared: 0.8274
## Root Mean Squared Error: 1.422

Spark machine learning supports a wide array of algorithms and feature transformations and as illustrated above it's easy to chain these functions together with dplyr pipelines. To learn more see the machine learning section.

Reading and Writing Data

You can read and write data in CSV, JSON, and Parquet formats. Data can be stored in HDFS, S3, or on the local filesystem of cluster nodes.

temp_csv <- tempfile(fileext = ".csv")
temp_parquet <- tempfile(fileext = ".parquet")
temp_json <- tempfile(fileext = ".json")

spark_write_csv(iris_tbl, temp_csv)
iris_csv_tbl <- spark_read_csv(sc, "iris_csv", temp_csv)

spark_write_parquet(iris_tbl, temp_parquet)
iris_parquet_tbl <- spark_read_parquet(sc, "iris_parquet", temp_parquet)

spark_write_json(iris_tbl, temp_json)
iris_json_tbl <- spark_read_json(sc, "iris_json", temp_json)

src_tbls(sc)
## [1] "batting"      "flights"      "iris"         "iris_csv"    
## [5] "iris_json"    "iris_parquet" "mtcars"

Distributed R

You can execute arbitrary r code across your cluster using spark_apply. For example, we can apply rgamma over iris as follows:

spark_apply(iris_tbl, function(data) {
  data[1:4] + rgamma(1,2)
})
## # Source:   table<sparklyr_tmp_117d835ce14f9> [?? x 4]
## # Database: spark_connection
##    Sepal_Length Sepal_Width Petal_Length Petal_Width
##           <dbl>       <dbl>        <dbl>       <dbl>
##  1     9.983684    8.383684     6.283684    5.083684
##  2     9.783684    7.883684     6.283684    5.083684
##  3     9.583684    8.083684     6.183684    5.083684
##  4     9.483684    7.983684     6.383684    5.083684
##  5     9.883684    8.483684     6.283684    5.083684
##  6    10.283684    8.783684     6.583684    5.283684
##  7     9.483684    8.283684     6.283684    5.183684
##  8     9.883684    8.283684     6.383684    5.083684
##  9     9.283684    7.783684     6.283684    5.083684
## 10     9.783684    7.983684     6.383684    4.983684
## # ... with more rows

You can also group by columns to perform an operation over each group of rows and make use of any package within the closure:

spark_apply(
  iris_tbl,
  function(e) broom::tidy(lm(Petal_Width ~ Petal_Length, e)),
  names = c("term", "estimate", "std.error", "statistic", "p.value"),
  group_by = "Species"
)
## # Source:   table<sparklyr_tmp_117d876fbf859> [?? x 6]
## # Database: spark_connection
##      Species         term    estimate  std.error  statistic      p.value
##        <chr>        <chr>       <dbl>      <dbl>      <dbl>        <dbl>
## 1 versicolor  (Intercept) -0.08428835 0.16070140 -0.5245029 6.023428e-01
## 2 versicolor Petal_Length  0.33105360 0.03750041  8.8279995 1.271916e-11
## 3  virginica  (Intercept)  1.13603130 0.37936622  2.9945505 4.336312e-03
## 4  virginica Petal_Length  0.16029696 0.06800119  2.3572668 2.253577e-02
## 5     setosa  (Intercept) -0.04822033 0.12164115 -0.3964146 6.935561e-01
## 6     setosa Petal_Length  0.20124509 0.08263253  2.4354220 1.863892e-02

Extensions

The facilities used internally by sparklyr for its dplyr and machine learning interfaces are available to extension packages. Since Spark is a general purpose cluster computing system there are many potential applications for extensions (e.g. interfaces to custom machine learning pipelines, interfaces to 3rd party Spark packages, etc.).

Here's a simple example that wraps a Spark text file line counting function with an R function:

# write a CSV 
tempfile <- tempfile(fileext = ".csv")
write.csv(nycflights13::flights, tempfile, row.names = FALSE, na = "")

# define an R interface to Spark line counting
count_lines <- function(sc, path) {
  spark_context(sc) %>% 
    invoke("textFile", path, 1L) %>% 
      invoke("count")
}

# call spark to count the lines of the CSV
count_lines(sc, tempfile)
## [1] 336777

To learn more about creating extensions see the Extensions section of the sparklyr website.

Table Utilities

You can cache a table into memory with:

tbl_cache(sc, "batting")

and unload from memory using:

tbl_uncache(sc, "batting")

Connection Utilities

You can view the Spark web console using the spark_web function:

spark_web(sc)

You can show the log using the spark_log function:

spark_log(sc, n = 10)
## 17/08/25 12:54:28 INFO DAGScheduler: Submitting 1 missing tasks from ResultStage 72 (/var/folders/vd/krh_y3qd0c5bw8k77lmdtw7r0000gn/T//Rtmps6VbEg/file117d8538598e1.csv MapPartitionsRDD[293] at textFile at NativeMethodAccessorImpl.java:0)
## 17/08/25 12:54:28 INFO TaskSchedulerImpl: Adding task set 72.0 with 1 tasks
## 17/08/25 12:54:28 INFO TaskSetManager: Starting task 0.0 in stage 72.0 (TID 112, localhost, executor driver, partition 0, PROCESS_LOCAL, 6010 bytes)
## 17/08/25 12:54:28 INFO Executor: Running task 0.0 in stage 72.0 (TID 112)
## 17/08/25 12:54:28 INFO HadoopRDD: Input split: file:/var/folders/vd/krh_y3qd0c5bw8k77lmdtw7r0000gn/T/Rtmps6VbEg/file117d8538598e1.csv:0+33313106
## 17/08/25 12:54:28 INFO Executor: Finished task 0.0 in stage 72.0 (TID 112). 1123 bytes result sent to driver
## 17/08/25 12:54:28 INFO TaskSetManager: Finished task 0.0 in stage 72.0 (TID 112) in 114 ms on localhost (executor driver) (1/1)
## 17/08/25 12:54:28 INFO TaskSchedulerImpl: Removed TaskSet 72.0, whose tasks have all completed, from pool 
## 17/08/25 12:54:28 INFO DAGScheduler: ResultStage 72 (count at NativeMethodAccessorImpl.java:0) finished in 0.114 s
## 17/08/25 12:54:28 INFO DAGScheduler: Job 49 finished: count at NativeMethodAccessorImpl.java:0, took 0.117630 s

Finally, we disconnect from Spark:

spark_disconnect(sc)

RStudio IDE

The latest RStudio Preview Release of the RStudio IDE includes integrated support for Spark and the sparklyr package, including tools for:

  • Creating and managing Spark connections
  • Browsing the tables and columns of Spark DataFrames
  • Previewing the first 1,000 rows of Spark DataFrames

Once you've installed the sparklyr package, you should find a new Spark pane within the IDE. This pane includes a New Connection dialog which can be used to make connections to local or remote Spark instances:

Once you've connected to Spark you'll be able to browse the tables contained within the Spark cluster and preview Spark DataFrames using the standard RStudio data viewer:

You can also connect to Spark through Livy through a new connection dialog:

The RStudio IDE features for sparklyr are available now as part of the RStudio Preview Release.

Using H2O

rsparkling is a CRAN package from H2O that extends sparklyr to provide an interface into Sparkling Water. For instance, the following example installs, configures and runs h2o.glm:

options(rsparkling.sparklingwater.version = "2.1.0")

library(rsparkling)
library(sparklyr)
library(dplyr)
library(h2o)

sc <- spark_connect(master = "local", version = "2.1.0")
mtcars_tbl <- copy_to(sc, mtcars, "mtcars")

mtcars_h2o <- as_h2o_frame(sc, mtcars_tbl, strict_version_check = FALSE)

mtcars_glm <- h2o.glm(x = c("wt", "cyl"), 
                      y = "mpg",
                      training_frame = mtcars_h2o,
                      lambda_search = TRUE)
mtcars_glm
## Model Details:
## ==============
## 
## H2ORegressionModel: glm
## Model ID:  GLM_model_R_1503683692912_1 
## GLM Model: summary
##     family     link                              regularization
## 1 gaussian identity Elastic Net (alpha = 0.5, lambda = 0.1013 )
##                                                                lambda_search
## 1 nlambda = 100, lambda.max = 10.132, lambda.min = 0.1013, lambda.1se = -1.0
##   number_of_predictors_total number_of_active_predictors
## 1                          2                           2
##   number_of_iterations                                training_frame
## 1                    0 frame_rdd_29_970371551cefadb7219d3e25e94a4bc0
## 
## Coefficients: glm coefficients
##       names coefficients standardized_coefficients
## 1 Intercept    38.941654                 20.090625
## 2       cyl    -1.468783                 -2.623132
## 3        wt    -3.034558                 -2.969186
## 
## H2ORegressionMetrics: glm
## ** Reported on training data. **
## 
## MSE:  6.017684
## RMSE:  2.453097
## MAE:  1.940985
## RMSLE:  0.1114801
## Mean Residual Deviance :  6.017684
## R^2 :  0.8289895
## Null Deviance :1126.047
## Null D.o.F. :31
## Residual Deviance :192.5659
## Residual D.o.F. :29
## AIC :156.2425
spark_disconnect(sc)

Connecting through Livy

Livy enables remote connections to Apache Spark clusters. Connecting to Spark clusters through Livy is under experimental development in sparklyr. Please post any feedback or questions as a GitHub issue as needed.

Before connecting to Livy, you will need the connection information to an existing service running Livy. Otherwise, to test livy in your local environment, you can install it and run it locally as follows:

livy_install()
livy_service_start()

To connect, use the Livy service address as master and method = "livy" in spark_connect. Once connection completes, use sparklyr as usual, for instance:

sc <- spark_connect(master = "http://localhost:8998", method = "livy")
copy_to(sc, iris)
## # Source:   table<iris> [?? x 5]
## # Database: spark_connection
##    Sepal_Length Sepal_Width Petal_Length Petal_Width Species
##           <dbl>       <dbl>        <dbl>       <dbl>   <chr>
##  1          5.1         3.5          1.4         0.2  setosa
##  2          4.9         3.0          1.4         0.2  setosa
##  3          4.7         3.2          1.3         0.2  setosa
##  4          4.6         3.1          1.5         0.2  setosa
##  5          5.0         3.6          1.4         0.2  setosa
##  6          5.4         3.9          1.7         0.4  setosa
##  7          4.6         3.4          1.4         0.3  setosa
##  8          5.0         3.4          1.5         0.2  setosa
##  9          4.4         2.9          1.4         0.2  setosa
## 10          4.9         3.1          1.5         0.1  setosa
## # ... with more rows
spark_disconnect(sc)

Once you are done using livy locally, you should stop this service with:

livy_service_stop()

To connect to remote livy clusters that support basic authentication connect as:

config <- livy_config_auth("<username>", "<password">)
sc <- spark_connect(master = "<address>", method = "livy", config = config)
spark_disconnect(sc)

Functions in sparklyr

Name Description
copy_to.spark_connection Copy an R Data Frame to Spark
core_spark_apply_bundle Creates a bundle of dependencies required by spark_apply()
ft_bucketizer Feature Transformation -- Bucketizer
ft_count_vectorizer Feature Tranformation -- CountVectorizer
ft_string_indexer Feature Transformation -- StringIndexer
ft_tokenizer Feature Tranformation -- Tokenizer
livy_service_start Start Livy
ml_als_factorization Spark ML -- Alternating Least Squares (ALS) matrix factorization.
ml_lda Spark ML -- Latent Dirichlet Allocation
ml_linear_regression Spark ML -- Linear Regression
ml_random_forest Spark ML -- Random Forests
ml_saveload Save / Load a Spark ML Model Fit
register_extension Register a Package that Implements a Spark Extension
sdf-saveload Save / Load a Spark DataFrame
sdf_project Project features onto principal components
sdf_quantile Compute (Approximate) Quantiles with a Spark DataFrame
sdf_separate_column Separate a Vector Column into Scalar Columns
sdf_seq Create DataFrame for Range
spark_apply_log Log Writter for Spark Apply
spark_compilation_spec Define a Spark Compilation Specification
spark_default_version determine the version that will be used by default if version is NULL
spark_dependency Define a Spark dependency
download_scalac Downloads default Scala Compilers
ensure Enforce Specific Structure for R Objects
ft_quantile_discretizer Feature Transformation -- QuantileDiscretizer
ft_regex_tokenizer Feature Tranformation -- RegexTokenizer
livy_config Create a Spark Configuration for Livy
livy_install Install Livy
ml_gradient_boosted_trees Spark ML -- Gradient-Boosted Tree
ml_kmeans Spark ML -- K-Means Clustering
spark_read_jdbc Read from JDBC connection into a Spark DataFrame.
spark_read_json Read a JSON file into a Spark DataFrame
spark_versions Retrieves a dataframe available Spark versions that van be installed.
spark_web Open the Spark web interface
ml_logistic_regression Spark ML -- Logistic Regression
ml_model Create an ML Model Object
na.replace Replace Missing Values in Objects
%>% Pipe operator
sdf_coalesce Coalesces a Spark DataFrame
sdf_copy_to Copy an Object into Spark
sdf_partition Partition a Spark Dataframe
sdf_persist Persist a Spark DataFrame
sdf_sort Sort a Spark DataFrame
sdf_with_sequential_id Add a Sequential ID Column to a Spark DataFrame
spark-connections Manage Spark Connections
DBISparkResult-class DBI Spark Result.
checkpoint_directory Set/Get Spark checkpoint directory
ft_index_to_string Feature Transformation -- IndexToString
ft_one_hot_encoder Feature Transformation -- OneHotEncoder
ft_vector_assembler Feature Transformation -- VectorAssembler
hive_context_config Runtime configuration interface for Hive
ml_generalized_linear_regression Spark ML -- Generalized Linear Regression
spark_apply Apply an R Function in Spark
spark_install_find Find a given Spark installation by version.
spark_install_sync helper function to sync sparkinstall project to sparklyr
spark_read_table Reads from a Spark Table into a Spark DataFrame.
spark_read_text Read a Text file into a Spark DataFrame
spark_save_table Saves a Spark DataFrame as a Spark table
spark_table_name Generate a Table Name from Expression
tbl_cache Cache a Spark Table
ml_glm_tidiers Tidying methods for Spark ML linear models
ml_model_data Extracts data associated with a Spark ML model
ml_multilayer_perceptron Spark ML -- Multilayer Perceptron
ml_survival_regression Spark ML -- Survival Regression
ml_tree_feature_importance Spark ML - Feature Importance for Tree Models
sdf_along Create DataFrame for along Object
sdf_bind Bind multiple Spark DataFrames by row and column
sdf_pivot Pivot a Spark DataFrame
connection_is_open Check whether the connection is open
connection_spark_shinyapp A Shiny app that can be used to construct a spark_connect statement
find_scalac Discover the Scala Compiler
ft_binarizer Feature Transformation -- Binarizer
ft_sql_transformer Feature Transformation -- SQLTransformer
ft_stop_words_remover Feature Tranformation -- StopWordsRemover
ml_binary_classification_eval Spark ML - Binary Classification Evaluator
ml_classification_eval Spark ML - Classification Evaluator
ml_options Options for Spark ML Routines
ml_pca Spark ML -- Principal Components Analysis
ml_prepare_dataframe Prepare a Spark DataFrame for Spark ML Routines
ml_prepare_response_features_intercept Pre-process the Inputs to a Spark ML Routine
sdf_broadcast Broadcast hint
sdf_checkpoint Checkpoint a Spark DataFrame
sdf_mutate Mutate a Spark DataFrame
sdf_num_partitions Gets number of partitions of a Spark DataFrame
sdf_read_column Read a Column from a Spark DataFrame
sdf_register Register a Spark DataFrame
spark_compile Compile Scala sources into a Java Archive
spark_config Read Spark Configuration
spark_home_dir Find the SPARK_HOME directory for a version of Spark
spark_home_set Set the SPARK_HOME environment variable
spark_jobj Retrieve a Spark JVM Object Reference
spark_load_table Reads from a Spark Table into a Spark DataFrame.
spark_write_csv Write a Spark DataFrame to a CSV
spark_write_jdbc Writes a Spark DataFrame into a JDBC table
spark_write_source Writes a Spark DataFrame into a generic source
tbl_change_db Use specific database
spark_write_table Writes a Spark DataFrame into a Spark table
sdf_predict Model Predictions with Spark DataFrames
sdf_sample Randomly Sample Rows from a Spark DataFrame
sdf_schema Read the Schema of a Spark DataFrame
compile_package_jars Compile Scala sources into a Java Archive (jar)
spark_config_exists A helper function to check value exist under spark_config()
spark_config_value A helper function to retrieve values from spark_config()
spark_dataframe Retrieve a Spark DataFrame
spark_default_compilation_spec Default Compilation Specification for Spark Extensions
spark_read_parquet Read a Parquet file into a Spark DataFrame
spark_read_source Read from a generic source into a Spark DataFrame.
spark_version Get the Spark Version Associated with a Spark Connection
spark_version_from_home Get the Spark Version Associated with a Spark Installation
spark_write_text Write a Spark DataFrame to a Text file
src_databases Show database list
connection_config Read configuration values for a connection
ft_discrete_cosine_transform Feature Transformation -- Discrete Cosine Transform (DCT)
ft_elementwise_product Feature Transformation -- ElementwiseProduct
invoke Invoke a Method on a JVM Object
invoke_method Generic call interface for spark shell
ml_create_dummy_variables Create Dummy Variables
ml_decision_tree Spark ML -- Decision Trees
ml_naive_bayes Spark ML -- Naive-Bayes
ml_one_vs_rest Spark ML -- One vs Rest
print_jobj Generic method for print jobj for a connection type
reexports Objects exported from other packages
sdf_dim Support for Dimension Operations
sdf_fast_bind_cols Fast cbind for Spark DataFrames
sdf_last_index Returns the last index of a Spark DataFrame
sdf_len Create DataFrame for Length
sdf_repartition Repartition a Spark DataFrame
sdf_residuals.ml_model_generalized_linear_regression Model Residuals
sdf_with_unique_id Add a Unique ID Column to a Spark DataFrame
spark-api Access the Spark API
spark_connection Retrieve the Spark Connection Associated with an R Object
spark_context_config Runtime configuration interface for Spark.
spark_log View Entries in the Spark Log
spark_read_csv Read a CSV file into a Spark DataFrame
spark_write_json Write a Spark DataFrame to a JSON file
spark_write_parquet Write a Spark DataFrame to a Parquet file
tbl_uncache Uncache a Spark Table
worker_spark_apply_unbundle Extracts a bundle of dependencies required by spark_apply()
No Results!

Vignettes of sparklyr

Name
deployment-amazon-ec2.Rmd
deployment-amazon-emr.Rmd
deployment-amazon.Rmd
deployment-cdh.Rmd
deployment-connections.Rmd
deployment-data-lakes.Rmd
deployment-overview.Rmd
gallery.Rmd
guides-caching.Rmd
guides-distributed-r.Rmd
guides-dplyr.Rmd
guides-extensions.Rmd
guides-h2o.Rmd
guides-mllib.Rmd
guides-textmining.Rmd
reference-media.Rmd
No Results!

Last month downloads

Details

Include our badge in your README

[![Rdoc](http://www.rdocumentation.org/badges/version/sparklyr)](http://www.rdocumentation.org/packages/sparklyr)