Error when creating a library with a polymorphic transform - R UDx

Hi,

 

I'm trying to create a library which contains a polymorphic transform, but keep getting the following error:

 

SQL Error [3399] [VP001]: [Vertica][VJDBC](3399) ROLLBACK: Failure in UDx RPC call InvokeSetExecContext(): Error calling setupExecContext() in User Defined Object [] at [/scratch_a/release/16125/vbuild/vertica/OSS/UDxFence/vertica-udx-R.cpp:139], error code: 0, message: Exception in Validate Library:<text>:1:30: unexpected input

I have also tried to run the example given in: https://my.vertica.com/docs/7.1.x/HTML/Content/Authoring/ExtendingHPVertica/UDx/UDxR/PolymorphicFunctionsInR.htm

 

and still get the same error.

 

Here is my R code:

 

DetectSeasonality <- function(x,y)
{
library('AnomalyDetection')
ifelse(!is.null(y[['TimeInterval']]),TimeInterval = as.numeric(y[['TimeInterval']]),stop("Expected parameter TimeInterval"))
ifelse(!is.null(y[['SmoothingMethod']]),SmoothingMethod = as.character(y[['SmoothingMethod']]),stop("Expected parameter SmoothingMethod"))
ifelse(!is.null(y[['alpha']]),alpha = as.numeric(y[['alpha']]),stop("Expected parameter alpha"))
ifelse(!is.null(y[['beta']]),beta = as.numeric(y[['beta']]),stop("Expected parameter beta"))
ifelse(!is.null(y[['LowValues']]),LowValues = as.numeric(y[['LowValues']]),stop("Expected parameter LowValues"))
ifelse(!is.null(y[['CutIntervals']]),CutIntervals = as.numeric(y[['CutIntervals']]),stop("Expected parameter CutIntervals"))
dataResult = FindSeasonality(x,TimeInterval,SmoothingMethod,alpha,beta,LowValues,CutIntervals)
dataResult
}
FindSeasonalityParams <- function()
{
params = data.frame(datatype=c('int','varchar','int','int','int','int'), length=rep(NA,6), scale=rep(NA,6), name=c("TimeInterval","SmoothingMethod","alpha","beta","LowValues","CutIntervals"))
params
}
DetectSeasonality_factory = function()
{
list(
name=DetectSeasonality,
udxtype=c("transform"),
intype=c("any"),
outtype=c("any"),
parametertypecallback=FindSeasonalityParams
)
}

My Vertica version is : Vertica Analytic Database v7.1.2-2

 

Thanks,

 

Kostia

Leave a Comment

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