UDX options

These constants are used by the getOptions method to modify the behavior of the nzLua UDX.

Table 1.
Option Description
OPT_AGGTYPE Only valid for a UDA. Default = any. This option determines if a UDA can be used in combination with the analytic OVER clause or the GROUP BY statement. Values indicate:
  • any --the UDA can be used with OVER or GROUP BY
  • analytic--UDA can only be used with the OVER clause
  • grouped--UDA can only be used with the GROUP BY statement
OPT_DETERMINISTIC A deterministic UDX always returns the same value for a given input. This allows the Netezza database to avoid calling the UDX multiple times if the arguments are the same. This option can be set to true or false.
OPT_FORCE_BIGNUM This option determines how integer and numeric values are passed to an nzLua UDX. Normally a value that can fit into a double is always passed as a double. Valid values for OPT_FORCE_BIGNUM are:
  • 0 - the default... only use bignum when necessary
  • 1 - use bignum for all bigint, numeric64, and numeric128 values
  • 2 - use bignum for all bigint, numeric, and double values
  • 3 - use bignum for all integer, numeric, and floating point values
OPT_MEMORY This setting does not directly affect memory for the UDX, instead it is used to tell the Netezza database how much memory the UDX uses (in megabytes). The OPT_MEMORY setting allows values between 1 and 128. The Netezza snippet scheduler uses this setting to make sure the system does not run out of memory while executing a query.
OPT_NULL_INPUT When set to false, a UDF will return NULL if any of the arguments are NULL (the evaluate() method will not be called). The default value for OPT_NULL_INPUT is true so that the evaluate() method will be called when any of the UDF arguments are NULL.
OPT_PARALLEL For a table function, setting OPT_PARALLEL=false forces the table function to run on the host as a single process instead of running in parallel on the SPUs.
OPT_REPLICATE_BY_SQL When true, a UDX is registered with the DDL clause REPLICATE BY SQL, which triggers replication by SQL instead of the default replicate by value (REPLICATE BY VALUE DDL clause). This option is used only for replication. By default, this option is false.
OPT_REQUIRE_FINAL For a table function, force the "WITH FINAL" syntax to be included to use the table function. See UDTF API Methods for more information.
OPT_UDA_MERGE_NULL The default behavior (false) of a nzLua UDA is to not call the merge() method when all of the state variables are null for one of the states. If this value is set to true the merge() method will always be called even when all of the state variables are null.
OPT_VARARGS_AS_TABLE Normally a VARARGS UDX receives the arguments using the Lua varargs syntax (...). Setting this option to true causes the VARARGS arguments to be passed to nzLua using a table instead of as a normal argument list.