我正在使用SAP HANA和R.我在R中使用cSPADE实现,因此将数据加载到临时文件中。 然而,直到知道它到目前为止工作正常,但现在我得到一个错误。这似乎是临时文件的一些问题。
Could not execute 'CALL "BETA_SYSTEM"."run"()' in 15.741 seconds .
SAP DBTech JDBC: [2048]: column store error: [2048] "BETA_SYSTEM"."run": line 21 col 2 (at pos 821): [2048] (range 3): column store error: [2048] "BETA_SYSTEM"."beta.procedures::selectSpadeData": line 33 col 4 (at pos 992): [2048] (range 3): column store error: search table error: [34082] Execution of R script failed.;Error in file(file, ifelse(append, "a", "w")) :
cannot open the connection
stack trace:
2: file(file, ifelse(append, "a", "w"))
1: write.table(spade_data, file = file, sep = " ", row.names = FALSE,
quote = FALSE, col.names = FALSE)
CREATE PROCEDURE BETA_SYSTEM.spadeR (
IN spade_data "SPADE_INPUT_T",
OUT result "SPADE_RESULT_T"
)
LANGUAGE RLANG
AS
BEGIN
library(Matrix)
library(arules)
library(arulesSequences)
file <- tempfile()
write.table(spade_data, file = file, sep = " ", row.names=FALSE, quote = FALSE, col.names=FALSE)
df_trans <- read_baskets(file, info=c("sequenceID", "eventID", "SIZE"))
as(df_trans, "data.frame")
err_res <- tryCatch({
s_res <- cspade(df_trans, parameter = list(support = 0), control = list(verbose = TRUE))
}, warning= function(war) {
}, error=function(err) {
}, finally={
}
)
if(length(err_res) == 0){
result<-data.frame(sequence="EMPTY",support=0)
} else {
result <- as(s_res, "data.frame")
}
END;
答案 0 :(得分:0)
错误堆栈表示访问该文件时出现问题。这发生在RSERV产生的R进程中。所以它在SAP HANA之外,我建议检查具有相同工作目录的R进程是否可以实际执行文件操作。
可能文件系统已满或访问权限已更改!?