Details
Description
Following code block reproduces the issue:
df <- createDataFrame(data.frame(x=1)) f1 <- function(x) x + 1 f2 <- function(x) f1(x) + 2 dapplyCollect(df, function(x) { f1(x); f2(x) })
We get following error message:
org.apache.spark.SparkException: R computation failed with
Error in f1(x) : could not find function "f1"
Calls: compute -> computeFunc -> f2
Compare that to this code block with succeeds:
dapplyCollect(df, function(x) { f2(x) })