Shaper and Sizer

Shapers are optionally called for Table Function AEs. Sizers are optionally called for Scalar Function AEs.

Data structures

struct NZAESHP_HANDLE
The Shaper Handle. An opaque handle used with Shaper and Sizer AE functions.

Functions

NzaeShpRcCode nzaeShpAddOutputColumn(NZAESHP_HANDLE handle, NzudsDataType dataType, const char *columnName)
Adds Non string/numeric Output Columns.
NzaeShpRcCode nzaeShpAddOutputColumnNumeric(NZAESHP_HANDLE handle, NzudsDataType data-Type, const char *columnName, int precision, int scale)
Adds Numeric Output Columns.
NzaeShpRcCode nzaeShpAddOutputColumnString(NZAESHP_HANDLE handle, NzudsDataType dataType, const char *columnName, int size)
Adds String Output Columns.
void nzaeShpClose(NZAESHP_HANDLE handle)
Closes the handle when done.
NzaeShpRcCode nzaeShpGetEnv(NZAESHP_HANDLE handle, const char *name, const char **result)
Gets an AE or system environment variable. AE has precedence.
void nzaeShpGetFirstEnvironmentEntry(NZAESHP_HANDLE handle, NzaeEnvironmentEntry *entry)
Returns the first environment entry.
NzaeShpRcCode nzaeShpGetInputColumn(NZAESHP_HANDLE handle, int index, NzudsData **data)
Gets the input column data
AeUserCode nzaeShpGetLastErrorCode(NZAESHP_HANDLE handle)
Gets the code for last error that occurred.
const char* nzaeShpGetLastErrorText(NZAESHP_HANDLE handle)
Gets the message text for last error that occurred.
const char* nzaeShpGetLibraryFullPath(NZAESHP_HANDLE h, const char *libraryName, bool caseSensitive)
Gets the file path for a library name.
NzaeSharedLibraryInfo* nzaeShpGetLibraryInfo(NZAESHP_HANDLE h)
Returns NzaeSharedLibraryInfo of the shared library for this request.
NzaeSharedLibraryInfo* nzaeShpGetLibraryProcessInfo(NZAESHP_HANDLE h)
Return NzaeSharedLibraryInfo of the shared library for the process. Returns NULL if the AE is not remote.
NzaeShpRcCode nzaeShpGetMetadata(NZAESHP_HANDLE handle, NzaeShpMetadata *arg)
Gets metadata about the AE Shaper.
bool nzaeShpGetNextEnvironmentEntry(NZAESHP_HANDLE handle, NzaeEnvironmentEntry *entry)
Returns the next environment entry.
int nzaeShpGetNumberOfParameters(NZAESHP_HANDLE h)
Returns the number of parameters.
int nzaeShpGetNumOutputColumns(NZAESHP_HANDLE handle)
Returns the number of output columns added by the user.
NzaeShpRcCode nzaeShpGetOutputColumnInfo(NZAESHP_HANDLE handle, int index, NzaeSh-pOutputColumnInfo *info)
Gets information about an output column added by the user.
const char* nzaeShpGetParameter(NZAESHP_HANDLE h, int index)
Returns a parameter.
NzaeShpRcCode nzaeShpGetRuntime(NZAESHP_HANDLE handle, NzaeRuntime *arg)
Gets runtime information about the AE Shaper.
const char* nzaeShpGetSystemLogFileName(NZAESHP_HANDLE handle)
Gets the AE System Log File name.
NzaeShpRcCode nzaeShpGetUdfReturnType(NZAESHP_HANDLE handle, NzudsDataType *data-Type)
For a UDF only, gets the predetermined single return data type.
NzaeShpRcCode nzaeShpLog(NZAESHP_HANDLE handle, NzaeLogLevel level, const char *mes-sage)
Logs the specified message.
NzaeShpRcCode nzaeShpPing(NZAESHP_HANDLE handle)
Indicates that the AE Shaper is still active and not hanging.
NzaeShpRcCode nzaeShpSystemCatalogIsUpper(NZAESHP_HANDLE handle, bool *result)
Returns TRUE if the default for system catalog names is upper case.
NzaeShpRcCode nzaeShpUpdate(NZAESHP_HANDLE handle)
Updates the shape and size information in the Netezza system.
NzaeShpRcCode nzaeShpUserError(NZAESHP_HANDLE handle, const char *_template,...)
Indicates that this AE has encountered an error condition.

Enumerations

enum NzaeShpRcCode { NZAESHP_RC_ERROR= -1, NZAESHP_RC_NORMAL= 0 }
Return codes from nzaeShp Shaper functions.

Detailed description

Shapers are optionally called for Table Function AEs. Sizers are optionally called for Scalar Function AEs.

Function documentation

NzaeShpRcCode nzaeShpAddOutputColumn(NZAESHP_HANDLE handle, NzudsDataType dataType, const char *columnName)
Adds Non string/numeric Output Columns.
Parameters:
  • handle

    The Shaper handle

  • NzudsDataType dataType

    The data type.

  • columnName

    The column name.

    Returns

    NzaeShpRcCode

    The Shaper return code.

NzaeShpRcCode nzaeShpAddOutputColumnNumeric(NZAESHP_HANDLE handle, NzudsDataType data-Type, const char *columnName, int precision, int scale)
Adds Numeric Output Columns.
Parameters:
  • handle

    The Shaper handle

  • NzudsDataType dataType

    The data type.

  • columnName

    The column name.

  • precision

    The column precision.

  • scale

    The column scale.

    Returns

    NzaeShpRcCode

    The Shaper return code.

NzaeShpRcCode nzaeShpAddOutputColumnString(NZAESHP_HANDLE handle, NzudsDataType dataType, const char *columnName, int size)
Adds String Output Columns.
Parameters:
  • handle

    The Shaper handle

  • NzudsDataType dataType

    The data type.

  • columnName

    The column name.

  • size

    The column size.

    Returns

    NzaeShpRcCode

    The Shaper return code.

void nzaeShpClose(NZAESHP_HANDLE handle)
Closes the handle when done.
Parameters:
  • handle

    The Shaper handle.

NzaeShpRcCode nzaeShpGetEnv(NZAESHP_HANDLE handle, const char *name, const char **result)
Gets an AE or system environment variable. AE has precedence.
Parameters:
  • handle

    The Shaper handle

  • name

    The variable name.

  • result

    The variable value or NULL if not found.

    Returns

    NzaeShpRcCode

    The Shaper return code.

void nzaeShpGetFirstEnvironmentEntry(NZAESHP_HANDLE handle, NzaeEnvironmentEntry *entry)
Returns the first environment entry.
Parameters:
  • handle

    The Shaper handle.

  • NzaeEnvironmentEntry entry

    The first entry.

    This function call is followed by repeated calls to nzaeGetNextEnvironmentEntry. The AE system owns the memory from this call.

NzaeShpRcCode nzaeShpGetInputColumn(NZAESHP_HANDLE handle, int index, NzudsData **data)
Gets the input column data
Parameters:
  • handle

    The Shaper handle

  • index

    The input index.

  • NzudsData data

    The input data.

    Returns

    NzaeShpRcCode

    The Shaper return code.

    If isConstant is FALSE then the value is always NULL.

AeUserCode nzaeShpGetLastErrorCode(NZAESHP_HANDLE handle)
Gets the code for last error that occurred.
Parameters:
  • handle

    The Shaper handle

    Returns

    AeUserCode

    The error code of the last occurring error.

const char* nzaeShpGetLastErrorText(NZAESHP_HANDLE handle)
Gets the message text for last error that occurred.
Parameters:
  • handle

    The Shaper handle

    Returns

    The message text of the last occurring error.

const char* nzaeShpGetLibraryFullPath(NZAESHP_HANDLE h, const char *libraryName, bool caseSensitive)
Gets the file path for a library name.
Parameters:
  • h

    The Shaper handle

  • libraryName

    The library name.

  • caseSensitive

    If TRUE, the lookup is case-sensitive.

    Returns

    The file path if found; NULL otherwise.

    Returns NULL if the library is not found. The AE system owns the memory from this call.

NzaeSharedLibraryInfo* nzaeShpGetLibraryInfo(NZAESHP_HANDLE h)
Returns NzaeSharedLibraryInfo of the shared library for this request.
Parameters:
  • h

    The Shaper handle

    Returns

    NzaeSharedLibraryInfo

    The Shared Library information.

    The AE system owns the memory from this call.

NzaeSharedLibraryInfo* nzaeShpGetLibraryProcessInfo(NZAESHP_HANDLE h)
Return NzaeSharedLibraryInfo of the shared library for the process. Returns NULL if the AE is not remote.
Parameters:
  • h

    The Shaper handle

    Returns

    NzaeSharedLibraryInfo

    The Shared Library information.

    The AE system owns the memory from this call.

NzaeShpRcCode nzaeShpGetMetadata(NZAESHP_HANDLE handle, NzaeShpMetadata *arg)
Gets metadata about the AE Shaper.
Parameters:
  • handle

    The Shaper handle

  • NzaeShpMetadata arg

    The metadata to be filled out. Created by the caller.

    Returns

    NzaeShpRcCode

    The Shaper return code.

bool nzaeShpGetNextEnvironmentEntry(NZAESHP_HANDLE handle, NzaeEnvironmentEntry *entry)
Returns the next environment entry.
Parameters:
  • handle

    The Shaper handle

  • NzaeEnvironmentEntry entry

    The next entry.

    Returns

    FALSE on end.

    The first nzaeGetNextEnvironmentEntry must follow a call to nzaeGetFirstEnvironmentEntry. Returns FALSE on end. Key names may repeat but the current version of a keyname is given last. The AE system owns the memory from this call.

int nzaeShpGetNumberOfParameters(NZAESHP_HANDLE h)
Returns the number of parameters.
Parameters:
  • h

    The Shaper handle.

    Returns

    The number of parameters.
int nzaeShpGetNumOutputColumns(NZAESHP_HANDLE handle)
Returns the number of output columns added by the user.
Parameters:
  • h

    The Shaper handle.

    Returns

    The number of output columns.
NzaeShpRcCode nzaeShpGetOutputColumnInfo(NZAESHP_HANDLE handle, int index, NzaeSh-pOutputColumnInfo *info)
Gets information about an output column added by the user.
Parameters:
  • h

    The Shaper handle.

  • index

    The output column index.

  • NzaeShpOutputColumnInfo info

    The output information.

    Returns

    NzaeShpRcCode

    The Shaper return code.

const char* nzaeShpGetParameter(NZAESHP_HANDLE h, int index)
Returns a parameter.
Parameters:
  • h

    The Shaper handle.

  • index

    The parameter index.

    Returns

    Parameter value.

    The index is zero-based.

NzaeShpRcCode nzaeShpGetRuntime(NZAESHP_HANDLE handle, NzaeRuntime *arg)
Gets runtime information about the AE Shaper.
Parameters:
  • h

    The Shaper handle.

  • NzaeRuntime arg

    The runtime to be filled out. Created by the caller.

    Returns

    NzaeShpRcCode

    The Shaper return code.

const char* nzaeShpGetSystemLogFileName(NZAESHP_HANDLE handle)
Gets the AE System Log File name.
Parameters:
  • handle

    The Shaper handle.

    Returns

    The log file name.

NzaeShpRcCode nzaeShpGetUdfReturnType(NZAESHP_HANDLE handle, NzudsDataType *data-Type)
For a UDF only, gets the predetermined single return data type.
Parameters:
  • handle

    The Shaper handle.

  • NzudsDataType dataType

    The return type.

    Returns

    NzaeShpRcCode

    The Shaper return code.

NzaeShpRcCode nzaeShpLog(NZAESHP_HANDLE handle, NzaeLogLevel level, const char *mes-sage)
Logs the specified message.
Parameters:
  • handle

    The Shaper handle.

  • NzaeLogLevel level

    The log level.

  • message

    The log message.

    Returns

    NzaeShpRcCode

    The Shaper return code.

NzaeShpRcCode nzaeShpPing(NZAESHP_HANDLE handle)
Indicates that the AE Shaper is still active and not hanging.
Parameters:
  • handle

    The Shaper handle.

    Returns

    NzaeShpRcCode

    The Shaper return code.

NzaeShpRcCode nzaeShpSystemCatalogIsUpper(NZAESHP_HANDLE handle, bool *result)
Returns TRUE if the default for system catalog names is upper case.
Parameters:
  • handle

    The Shaper handle.

  • result

    TRUE if catalog is upper case.

    Returns

    NzaeShpRcCode

    The Shaper return code.

NzaeShpRcCode nzaeShpUpdate(NZAESHP_HANDLE handle)
Updates the shape and size information in the Netezza system.
Parameters:
  • handle

    The Shaper handle.

    Returns

    NzaeShpRcCode

    The Shaper return code.

NzaeShpRcCode nzaeShpUserError(NZAESHP_HANDLE handle, const char *_template,...)
Indicates that this AE has encountered an error condition.
Parameters:
  • handle

    The Shaper handle.

  • _template

    The printf-stlye template.

    Returns

    NzaeShpRcCode

    The Shaper return code.

    The AE is complete and should exit after this call. Message is built like printf.

Enumeration type documentation

enum NzaeShpRcCode
Return codes from nzaeShp Shaper functions.

NZAESHP_RC_ERROR

NZAESHP_RC_NORMAL