UDTF R Error: RInterface.cpp:1387 Unable to find the cause.

edited March 2017 in General Discussion

Hi,

I am getting the following error when running an updated R UDF that calculates p-values. Having a very difficult time determining the cause of the error. We have similar code to calculate a fisher test which is working. Could use some help determining the cause of the error. The complete R UDF code is below.

[Vertica]VJDBC ERROR: Failure in UDx RPC call InvokeProcessPartition(): Error calling processPartition() in User Defined Object [p_adjust] at [/scratch_a/release/svrtar28745/vbuild/vertica/OSS/UDxFence/RInterface.cpp:1387], error code: 0, message: Exception in processPartitionForR: [Returned string value '[90]' with length [2] is greater than declared field length of [1] at output column index [0]])

R_version: R version 3.3.2 (2016-10-31)
Vertica Analytic Database v7.2.3-14


whatcurrentTime <- function() {
return(format(Sys.time(), "%Y-%m-%d %H:%M:%S"))
}

logMessage <- function(message) {
print(paste0(c(message, ": ", currentTime()), collapse=""))
}

p_adjust <- function(data, params) {
logMessage("Executing p_adjust")
logMessage("Extracting parameter values")

colnames(data) <- c("ID", "p_value")

res <- data.frame(ID=data$ID, p_value=data$p_value, stringsAsFactors=FALSE)

p_adjust_method <- match.arg(params[["method"]], choices=p.adjust.methods, several.ok=FALSE)

logMessage("Calculating adjusted p-values")
res$padj <- p.adjust(data$p_value, method=p_adjust_method)

return(res)

}

p_adjust_factory <- function() {
return(list(name=p_adjust, udxtype=c("transform"), intype=c("char", "float"),
outtype=c("char", "float", "float"),
outtypecallback=p_adjust_output, parametertypecallback=p_adjust_parameters, volatility=c("stable")))
}

p_adjust_output <- function(data, params) {
return(data.frame(datatype = c("char", "float", "float"), length = NA, scale = NA,
name = c("ID", "p_value", "padj")))
}

p_adjust_parameters <- function(data, params) {
return(data.frame(datatype = c("varchar"), length = NA, scale = NA, name = c("method")))
}

--- EOF ----

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file

Can't find what you're looking for? Search the Vertica Documentation, Knowledge Base, or Blog for more information.