From e4fe62afda2361760a2b705f5801ca93782fdff8 Mon Sep 17 00:00:00 2001 From: Alex Date: Sun, 1 Oct 2023 13:58:17 -0400 Subject: [PATCH] Update QuickstartNotebook.r Improve the SparkR library load --- notebooks/examples/R/QuickstartNotebook.r | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/notebooks/examples/R/QuickstartNotebook.r b/notebooks/examples/R/QuickstartNotebook.r index 2bbadec2d..41aa14798 100644 --- a/notebooks/examples/R/QuickstartNotebook.r +++ b/notebooks/examples/R/QuickstartNotebook.r @@ -24,14 +24,18 @@ print(paste0("The raw data is stored in ", raw_path)) # COMMAND ---------- -dbutils.fs.ls('dbfs:/databricks/mosaic/sparkrMosaic_0.3.4.tar.gz') - +mosaic_lib <- dbutils.fs.ls('dbfs:/databricks/mosaic/sparkrMosaic_0.3.4.tar.gz') +lib_path <- sapply(mosaic_lib, function(obj) obj$path) +lib_path <- lapply(lib_path, function(path) gsub('dbfs:/ml', '/dbfs/ml', path)) +lib_path + # COMMAND ---------- library(tidyverse) library(SparkR) -sparkr_mosaic_package_path = '/dbfs/databricks/mosaic/sparkrMosaic_0.3.4.tar.gz' +sparkr_mosaic_package_path = '/dbfs/databricks/mosaic/sparkrMosaic_0.3.4.tar.gz' # extract from above cell +# sparkr_mosaic_package_path = lib_path install.packages(sparkr_mosaic_package_path, repos=NULL) library(sparkrMosaic) sparkrMosaic::enableMosaic()