Reputation: 13
I am trying to create a procedure in HANA which uses R code. As a result I want to get the missing values counted. I tried the R code in R Studio and it works:
DROP Table "THESIS"."THESIS_FOLDER::COUNT_MISSING_VALUES";
CREATE Column TABLE "THESIS"."THESIS_FOLDER::COUNT_MISSING_VALUES" (RESULT" INT );
DROP PROCEDURE "THESIS"."ANALYSE_MISSINGDATA";
Create PROCEDURE "THESIS"."ANALYSE_MISSINGDATA" (IN input _SYS_BIC"."THESIS_FOLDER/CA_SAMPLE", OUT OUTPUT_DATA "THESIS"."THESIS_FOLDER::COUNT_MISSING_VALUE" )
LANGUAGE RLANG AS
BEGIN
result<-sapply(input, function(x) sum(is.na(x)))
OUTPUT_DATA<-data.frame(RESULT=result)
END;
Call "THESIS"."ANALYSE_MISSINGDATA"("_SYS_BIC"."THESIS_FOLDER/CA_SAMPLE",?);
But when I try this I get the following error: SAP DBTech JDBC: [2048]: column store error: search table error: [34084] Receive error: get result error.;Failure: Object 'output_data' not found.
Does anybody know what I did wrong?
Thanks.
Upvotes: 0
Views: 417
Reputation: 10396
The cause for the error message is that you refer to your output variable in UPPER case letters. Check the "SAP HANA R Integration Guide":
The variable names from the procedure definition should not contain uppercase letters. Therefore, the variable names in R should also not contain upper-case letters
Just change the OUTPUT_DATA<-data.frame(RESULT=result)
to output_data<-data.frame(RESULT=result)
and your code should work.
Upvotes: 1