@@ -39,30 +39,26 @@ sink(stderr())
3939# read function dependencies
4040depsLen <- readInt(inputCon )
4141if (depsLen > 0 ) {
42- execFunctionDeps <- readRawLen(inputCon , depsLen )
42+ execFunctionDeps <- readRawLen(inputCon , depsLen )
43+
44+ # load the dependencies into current environment
45+ depsFileName <- tempfile(pattern = " spark-exec" , fileext = " .deps" )
46+ depsFile <- file(depsFileName , open = " wb" )
47+ writeBin(execFunctionDeps , depsFile , endian = " big" )
48+ close(depsFile )
4349}
50+
4451# Include packages as required
4552packageNames <- unserialize(readRaw(inputCon ))
4653for (pkg in packageNames ) {
47- suppressPackageStartupMessages(require(as.character(pkg ), character.only = TRUE ))
54+ suppressPackageStartupMessages(require(as.character(pkg ), character.only = TRUE ))
4855}
56+
4957if (depsLen > 0 ) {
50- # load the dependencies into current environment
51- depsFileName <- tempfile(pattern = " spark-exec" , fileext = " .deps" )
52- depsFile <- file(depsFileName , open = " wb" )
53- writeBin(execFunctionDeps , depsFile , endian = " big" )
54- close(depsFile )
55-
5658 load(depsFileName )
5759 unlink(depsFileName )
5860}
5961
60- # Include packages as required
61- packageNames <- unserialize(readRaw(inputCon ))
62- for (pkg in packageNames ) {
63- suppressPackageStartupMessages(require(as.character(pkg ), character.only = TRUE ))
64- }
65-
6662# Read and set broadcast variables
6763numBroadcastVars <- readInt(inputCon )
6864if (numBroadcastVars > 0 ) {
0 commit comments