我正在尝试将现有的R代码移植到BigR。但dist方法会在移植的代码中触发错误。
现有代码:
mydata <- read.csv2("mydata.csv",header=T, sep=";", dec=",")
d1 <- dist(x = mydata,method = "euclidean")
移植代码:
mydata <- bigr.frame(dataSource="DEL",
dataPath="/user/bigr/mydata.csv", delimiter=";",
header=T, useMapReduce=T)
d1 <- tableApply(data = mydata,
rfunction = function(df) {
dist(df, method="euclidean")
})
将输出此错误:
Error: BigR[.bigr.jdbc.query.helper]: Error code : -1, SQLState : 02001
Caused by : originating expression ends at <string> (line: 4, column: 20): java.lang.RuntimeException: Wrong number of fields on input at position 132
originating expression ends at <string> (line: 4, column: 20)
at com.ibm.jaql.lang.expr.core.Expr.eval(Expr.java:883)
at com.ibm.jaql.lang.expr.core.DoExpr.evalRaw(DoExpr.java:160)
at com.ibm.jaql.lang.expr.core.Expr.eval(Expr.java:871)
at com.ibm.jaql.lang.expr.top.QueryExpr.evalRaw(QueryExpr.java:104)
at com.ibm.jaql.lang.expr.core.Expr.eval(Expr.java:871)
at com.ibm.jaql.lang.ParsedJaql.iter(ParsedJaql.java:243)
at com.ibm.biginsights.bigsql.jdbc.driver.service.JaqlQueryProcessor.execute2(JaqlQueryProcessor.java:121)
at com.ibm.biginsights.bigsql.jdbc.driver.service.JaqlQueryProcessor.execute(JaqlQueryProcessor.java:88)
at com.ibm.biginsights.bigsql.jdbc.driver.service.XQEJDBCDriverService.execute2(XQEJDBCDriverService.java:553)
at com.ibm.biginsights.
In addition: Warning message:
In is.na(parm) : is.na() applied to non-(list or vector) of type 'closure'