The error "No more spool space..." might occur when you score a model via a User Defined Function (UDF) with Teradata 14.0 or later


In Teradata 14.0 or later, when you try to score a model via a User Defined Function (UDF), you might encounter an error similar to the following:

ERROR: Teradata execute: No more spool space in xxxx.

This problem occurs because the Teradata optimizer takes the data and moves it to one Access Module Processor (AMP) when running a UDF that is defined as NOT DETERMINISTIC. The spool space available on that one AMP might not be enough for the data, thus resulting in the error.

A possible workaround is to create the UDF as DETERMINISTIC instead of NOT DETERMINISTIC. To make this change, follow these steps:

  1. Run the %INDTD_PUBLISH_MODEL macro doing an action=REPLACE and specifying the OUTDIR= argument.
  2. Go to the directory specified with the OUTDIR= setting and edit the BTEQInput.txt file.
  3. Add DETERMINISTIC between PARAMETER STYLE SQL and CALLED ON NULL INPUT for each function, as shown here:
PARAMETER STYLE SQL
DETERMINISTIC
CALLED ON NULL INPUT
  1. Take the code in the file and run in Batch Teradata Query (BTEQ).