Hello Community,
I have a stored procedure with very simple R code and output to a table with two columns. The stored procedure is created successfully, and the R commands run fine in R separate from HANA, but there seems to be some problem with how the script is being processed. Various errors are returned like END not found, "variable name" not found (see log excerpts below) depending on changes made to the very simple R script.
Can you help me shed some light on why this is happening?
System Details
- SAP HANA running on AWS instance
- RServe running on separate AWS instance
- R version 2.15.3
- Rserve version 0.6-8.1
Stored Procedure Code
CREATE PROCEDURE "SCHEMANAME"."STORED_PROCEDURE_TEST" (OUT results "SCHEMANAME"."RTEST")
LANGUAGE RLANG AS
/********* Begin Procedure Script ************/
BEGIN
v <- c(2,3,5,7,2,3)
w <- c(2,3,5,7,2,3)
results <- as.data.frame(cbind(w, v))
END;
/********* End Procedure Script ************/
Stored Procedure Call
CALL "SCHEMANAME"."STORED_PROCEDURE_TEST" ("SCHEMANAME"."RTEST") WITH OVERVIEW;
Errors
pop = executorPy.ceRPop() # pop1
pop.setNodeName('$$RESULTS$$_SYS_SS_CE_182588_TMP_CALL')
pop.setUseInternalTable()
pop.addViewAttribute('IP', datatype=73, intDigits=5, sqlType=3, sqlLength=5)
pop.addViewAttribute('IPNUMBER', datatype=73, intDigits=5, sqlType=3, sqlLength=5)
pop.setUserSchema('SYSTEM')
pop.addPlanDebugOpDataInfo(originalNodeName = '$$RESULTS$$', scenarioName = 'DATA_OVERLAY:_SYS_SS_CE_182588_TMP')
pop.setRScript('c(2,3,5,7,2,3)\nw <- c(2,3,5,7,2,3)\nresults <- as.data.frame(cbind(w, v))\n\n\nEND;')
pop.setROperationExecutionType(3)
pop.setRNodeEngineType(0)
pop.setRTimeout(3600)
pop.setRPid(0)
pop.setMaxSendSize(0)
pop.addRServerAddress(172.31.6.167:30020)
pop.setOrgNodeName('$$RESULTS$$')
[4943]{300040}[-151040] 2013-05-25 22:53:15.629844 e cePlanExec cePlanExecutor.cpp(06157) : Error during Plan execution of model DATA_OVERLAY:_SYS_SS_CE_182588_INS (-1), reason: Execution of R script failed.;Error in cbind(w, v) : object 'v' not found
stack trace:
2: cbind(w, v)
1: as.data.frame(cbind(w, v))
[5359]{300056}[-146705] 2013-05-25 16:36:06.584072 e RClient RserveConnection.cpp(00055) : Error: error message from Rserve is Error in <text>:1:71: unexpected symbol
1: s <- as.data.frame(cbind(c(2,3,5.5,7.1,2.1,3), c(2,3,5.5,7.1,2.1,3))) END
^
[5243]{300056}[-146708] 2013-05-25 16:36:30.359566 e RClient RserveConnection.cpp(00055) : Error: error message from Rserve is Error: object 'END' not found
[5240]{300056}[-146733] 2013-05-25 16:40:47.562231 e RClient RserveConnection.cpp(00478) : RserveConnection::parseRScript:parseRscript errror
regards,
Kence Anderson