当我将SparkR与sparkR.stop()结合使用时,可以很容易地停止Spark,如下面的代码块所示:
library(SparkR)
sparkR.session(master = "local")
sparkR.conf(SPARK_HOME)
sparkR.stop()
detach("package:SparkR", unload=TRUE)
在运行Sparklyr时我该怎么做?
library(sparklyr)
library(dplyr)
sc <- spark_connect(master = "local")
????? what do I enter here ???
detach("package:dplyr", unload=TRUE)
detach("package:sparklyr", unload=TRUE)
答案 0 :(得分:2)
尝试使用spark_disconnect()
sc <- spark_connect(master = "local") # open the connection
spark_disconnect(sc) # close the connection