Debug by using UDX stubs
You can replace calls to UDFs or UDAs with a stub object that returns a trivial value. Use this process to “turn off” your user-defined functions or aggregates if a table query fails. Disabling UDXs might also be helpful during times when you need to troubleshoot query performance or system issues such as SPU resets. The UDX stub capability is not supported for queries that run in the Postgres environment on the host.
The UDX stub capability is controlled by using an nzsql session variable called udx_stub. If you set the variable to true (or 1), UDXs are not executed fully. Instead, they return a basic value that essentially causes them to be ignored.
MYDB.SCHEMA(MYUSER)=> set udx_stub=1;The command returns the message SET VARIABLE if successful.
MYDB.SCHEMA(MYUSER)=> SELECT * FROM customers WHERE CustomerName(b) = 1; A | B
---+------------------
1 | Customer A
4 | Customer ABC
(2 rows)
A | B
---+------------------
3 | Customer CBA
1 | Customer A
4 | Customer ABC
2 | Customer B
(4 rows)
Essentially, with the UDX stub enabled, the WHERE clause does not restrict the output; therefore, the command displayed the entire table.
MYDB.SCHEMA(MYUSER)=> set udx_stub=0;