I'm passing integers as input to an R UDX function. However, when I just ask the function to return the same integer, I get different numbers! On the limited cases that I've looked at, it looks like it just increments for decrements by 1.
Here is an example:
R code:
longIntegerTest <- function (dt) {
names(dt) <- c('inInt')
result <- data.frame(input=dt$inInt);
}
longIntegerTest_factory <- function () {
list(name=longIntegerTest, udxtype=c("transform"), intype=c("int"), outtype=c("int"), outnames=c("res"))
}
SQL output:
timolin=> select longIntegerTest(12509528612683526) over();
res
-------------------
12509528612683526
timolin=> select longIntegerTest(12509528612683527) over();
res
-------------------
12509528612683528
(1 row)
You can see the error in the second function call.