Sizers
Sizers that are used by AEs are called from scalar functions to dynamically declare the return size of strings and numeric values.
For sizing to occur, the SQL scalar function is declared with return value CHAR(ANY), VARCHAR(ANY), NCHAR(ANY), or NVARCHAR(ANY) for strings and NUMERIC(ANY) for numeric values. As with shapers, for local AEs an instance for sizing is created on the host, and for remote AEs, a notification is made on the host. The instance is called only to provide this sizing information and is not used for processing data. The AE instance is called before any data is retrieved, which means it receives metadata about the input arguments and can also retrieve any arguments that are constant integers of type int4 only (not int1, int2, or int8).
Sizers are more limited than shapers, allowing only specification of the size of the string output or the precision and scale of a numeric output. The type is specified in the registration process. Sizers allow access only to literal int32 fields within the input data.
If an AE is registered as a SQL scalar function, which is declared with string return value CHAR(ANY) or NUMERIC(ANY), the AE must be written to perform both "sizing" and data processing. The same process instance never performs both, except in the case of a remote AE. Each AE language has an API function that indicates whether the AE is being used as a sizer or as a normal data processor.