【发布时间】:2019-10-21 08:21:17
【问题描述】:
我在 Windows 10 的 RStudio 中以本地模式运行 sparklyr:
spark_version <- "2.1.0"
sc <- spark_connect(master = "local", version = spark_version)
df <- data.frame(id = c(1, 1, 2, 2), county_code = c(1, 20, 321, 2))
sprintf("%03d",as.numeric(df$county_code))
df_tbl = copy_to(sc,df, "df_tbl", overwrite = TRUE)
df_tbl %>% summarise(sum = sum(county_code)) %>% collect() ## this works
## this does not:
df_tbl %>%
spark_apply(function(e) data.frame(sprintf("%03d",as.numeric(e$county_code), e),
names = c('county_code_fips', colnames(e))))
最后一行返回如下错误:
Error in file(con, "r") : cannot open the connection
In addition: Warning message:
In file(con, "r") :
cannot open file 'C:\Users\janni\AppData\Local\Temp\RtmpELRVxu\file4ab817055ccc_spark.log': Permission denied
这发生在我的笔记本电脑和台式机上。我尝试以管理员身份运行 RStudio,但它不会改变任何东西。
【问题讨论】: