outtypecallback Function

Function to define the column name(s), output data type(s), length/precision, and scale of the data being returned to Vertica.

Example

SalesTaxReturnTypes <- function(arguments.data.frame, parameters.data.frame) {
  output.return.type <- data.frame(datatype = rep(NA, 2),
                                   length   = rep(NA, 2),
                                   scale    = rep(NA, 2),
                                   name     = rep(NA, 2))
  output.return.type$datatype <- c("float", "float")
  output.return.type$name <- c("Sales Tax Rate", "Item Cost with Tax")
  return(output.return.type)
}

Arguments

arguments.data.frame
The data frame containing the arguments passed to the UDx from Vertica. This data frame is created and used internally by the UDx process.
parameters.data.frame
The data frame containing the parameters defined in the UDx from Vertica. This data frame is created and used internally by the UDx process.
datatype
The data type of the output.
length
(Optional) The dimension of the output.
scale
(Optional) The proportional dimensions of the output.
name
Column name of the output.

Description

When creating the outtypecallback function, define one row for each value returned. Use the same order as in the outtype defined in the factory function. If any of the columns are left blank or the outtypecallback function is omitted entirely, then Vertica uses default values.

Important: When specifying LONG VARCHAR or LONG VARBINARY data types, include the space between the two words. For example, datatype = c("long varchar").