-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update add configuration for sparklyr connection
- Loading branch information
Yo
committed
Apr 24, 2020
1 parent
6049d5a
commit 6bf466c
Showing
3 changed files
with
42 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,31 @@ | ||
# ------------------------------------------------------------------------------ | ||
# Declaration of enverimental variables for main execution routine | ||
# Setup of environment for execution of the main routine | ||
# | ||
# Author: Mario Loaiciga | ||
# [email protected] | ||
# ------------------------------------------------------------------------------ | ||
|
||
declare_libs_path <- function(spark_lib_path) { | ||
declare_spark_lib_path <- function(spark_lib_path) { | ||
# Declare path to the Spark library installation | ||
|
||
if (nchar(Sys.getenv("SPARK_HOME")) < 1) { | ||
Sys.setenv(SPARK_HOME = spark_lib_path) | ||
} | ||
} | ||
|
||
update_spark_connection_config <- function(sc_config) { | ||
# Update the empty `sc_config` with user-defined configs | ||
|
||
sc_config$'sparklyr.shell.executor-memory' <- SPARKLYR_SHELL_EXECUTOR_MEMORY | ||
sc_config$'sparklyr.shell.driver-memory' <- SPARKLYR_SHELL_DRIVER_MEMORY | ||
sc_config$spark.excutor.cores <- SPARK_EXCUTOR_CORES | ||
sc_config$spark.excutor.memory <- SPARK_EXCUTOR_MEMORY | ||
sc_config$spark.yarn.am.cores <- SPARK_YARN_AM_CORES | ||
sc_config$spark.excutor.instances <- SPARK_EXCUTOR_INSTANCES | ||
sc_config$spark.dynamicAllocation.enableds <- SPARK_DYNAMICALLOCATION_ENABLED | ||
sc_config$maximizeResourceAllocation <- MAXIMIZERESOURCEALLOCATION | ||
sc_config$spark.default.parallelism <- SPARK_DEFAULT_PARALLELISM | ||
|
||
return (sc_config) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters