The nzudxrunharness command

Runs a user-defined function or aggregate within a simulation test environment. The harness displays information about the memory usage of the objects, and it can detect buffer overwrites when the UDF/UDA is called. The command displays messages to standard output and optionally to the standard log files. You must be logged in as the nz user to run this command.

The command has the following syntax:
nzudxrunharness [OPTION]...
The following table describes the options that you can use for any instance of the command.
Table 1. The nzudxrunharness general options
Option Description
--dir datadir Specifies the location of the data directory, which is usually /nz/data.
--base base Specifies the base or home directory for the Netezza Performance Server software. The default is /nz/kit.
--user user Specifies the Netezza Performance Server database user to run this command. The user must be admin or the user who owns the target database that has the UDX. The default is the value of NZ_USER.
--pw password Specifies the Netezza Performance Server user password. The default is the value of NZ_PASSWORD.
--db database Specifies the database in which to run the UDX. The default is the NZ_DATABASE environment variable value.
--schema schema Specifies the schema in which to run the UDX. The default is the NZ_SCHEMA environment variable value.
-h Displays the usage for the command.
The following table describes the options that you use to specify the input file for the command.
Table 2. The nzudxrunharness input file options
Option Description
--file testfile Specifies the path name of a test data file. The columns must be in the order that is expected for the arguments and separated by commas (,).
--grp col Specifies the column number in the test data file that is used to group by (for aggregates). The test data file must already be grouped.
--sep separator Specifies the character that is used as a separator in the test file. The default is comma (,).
--escape escape Specifies the escape character to use in the test file. The default is none.
--quoting Uses double quotation marks for test file.
--hexinput Specifies that the data in the file is in hexadecimal input.
--generate Generates a control file, but does not run the harness. For more information, see Test harness control file.
The following table describes the other random input options for the command.
Table 3. The nzudxrunharness random input options
Option Description
--rows rows Specifies the number of rows to simulate. The default is 100.
--groups groups Specifies the number of groups to simulate. The default is 5.
--nulls nulls Specifies the null arguments. The value is specified as a colon-separated string of field numbers for example 1:2:3:5

The default is no nulls.

The following table describes the command output options.
Table 4. The nzudxrunharness output options
Option Description
--print Prints return values.
--hex Prints return values, with strings in hexadecimal format.
--novalidate Skips the buffer overrun validation steps. (The harness runs faster when you run without validation.)
--dbg Starts the debugger.
The following table describes the options that specify the UDX to test.
Table 5. The nzudxrunharness UDX options
Option Description
--name name Specifies the function or aggregate name. You can specify the function or aggregate name as it is, if the name is unique, or use a full signature such as func(return).
--func Operates on a function (default).
--agg Operates on an aggregate.
The following table describes the options that you use to override defined UDX values.
Table 6. The nzudxrunharness UDX override options
Option Description
--mask NONE, DEBUG, TRACE Specifies the logging mask override. Valid values are NONE, DEBUG, or TRACE. You can also specify a comma-separated combination of DEBUG, TRACE to log both types of messages.
--over override Specifies the string column size overrides. The value is specified as 1-40:2-400 where the first number is the column (1 based). The second number is the character size (not byte size).
--varargs cols Specifies the argument info for VARARGS UDX. You specify the value as a colon-separated series of types. For example: VARCHAR(100):NUMERIC(10,3):INT4
--fenced Runs the harness in fenced mode. This setting overrides the fencing that is defined for the UDX in the database.
--unfenced Runs the harness in unfenced mode. This setting overrides the fencing that is defined for the UDX in the database.
--object file Specifies an object file to use instead of the object file that is specified for the UDX in the database. You can also use the --data option with the --object option because it might be necessary for library object file locations.
--nodlclose Specifies that the test harness does not invoke the C library function dlclose() to close references to UNIX shared libraries that were made available with dlopen(). The test harness invokes dlclose() by default.

If you are running the test harness within a debugging tool such as valgrind or callgrind, specify this option so that the harness does not invoke dlclose() automatically. This allows you to access symbol names and other values that can be useful for debugging, but which might not available after dlclose() is called. (For more information about the valgrind debugging environment, see http://valgrind.org.)

--final For user-defined table functions, invokes the table function by using the TABLE WITH FINAL behavior.

The test harness runs the specified UDX by using either a supplied data file or by creating random data based on the --rows,--groups, and --nulls flags. With the --nulls flag, the specified columns are null about 50% of the time. Also, when you are using random data, strings are filled to maximum capacity, which either are based on the argument signature, or the overrides that are specified by --over. Using a supplied data file is the best way to test the correctness of your algorithm.

Using the --mask flags shows the results of logMsg calls. The --print and --hex flags show the results of evaluate or performFinalResult. The harness also prints external routines that are found in the object file. The --dbg flag invokes the debugger so that the actual object can be debugged. If you use the debugger, make sure that the host object file for the UDX is compiled with debugging symbols. (Typically, you would compile by using the optimized mode instead.)

In the data file, types like interval and timetz with more than one piece of information must have the fields that are separated by a colon (:). Nulls can be specified by <NULL>.