JavaScript Properties for WLM Rules
The following JavaScript properties are supported for manually scripting conditions and actions in WLM rules. See also Rule Conditions and Rule Actions; where applicable, each property is linked to a description of the equivalent UI control in the SMC. (Some properties do not exist as choices in the SMC.)
The read-only column indicates whether the JavaScript property is settable.
Yes
means that it is not settable; it can only be read from (that is,
used in a filter to make decisions).Name | Description | Data Type | Read-only |
---|---|---|---|
w.abort or w.abortReason |
Abort Query action (cancel query and return a reason message) | String | No |
w.allowSQB | Set Short Query Bias action (or a condition) | Boolean | No |
w.application | Application condition | String | No |
w.authenticatedUsername |
Condition on the user account that originates the session. If SET
ROLE is used, this value does not change. |
String | Yes |
w.command | Command condition | String | Yes |
w.cost | Cost condition | Number | Yes |
w.currentState | Current State condition. The state of a query can be filtered in a rule that
is defined for an earlier state (for example, a submit rule that
sets a timeout and executes when the query is in compile or
restart state). |
String | Yes |
w.database | Database condition | String | Yes |
w.duration or w.elapsedTime |
Total Duration condition. (w.duration and
w.elapsedTime are synonyms.) |
Number | Yes |
w.errorCode | Error Code condition | String | Yes |
w.errorMessage | Error Message condition | String | Yes |
w.errorRecoverable |
Recoverable Error condition; whether the query can be restarted on error (defined as part of the default error recovery policy). | Boolean | No |
w.execId |
Execution ID condition (where execution ID is the same value as a
query_id in sys.query ) |
Number | Yes |
w.executionDuration | Execution Duration condition | Number | Yes |
w.explainAnalyze |
EXPLAIN ANALYZE condition (whether the query is an
EXPLAIN ANALYZE command) |
Boolean | Yes |
w.externalScan |
External table scan condition | Boolean | Yes |
w.externalWrite |
External table write condition | Boolean | Yes |
log.debug , log.error ,
log.info , log.warn |
Action to log messages at different levels | String | Yes |
w.lookup | Set Lookup Query action; also a condition | Boolean | No |
w.maximumExecTimeLimit | Set Maximum Execution Time Limit action | Number | No |
w.maximumRowLimit | Set Maximum Row Limit action | Number | No |
w.maximumWaitLimit | Set Maximum Wait Limit action | Number | No |
w.memoryEstimate | Memory Estimate condition (value in MB, but equivalent to
memory_estimated_bytes in sys.query ) |
Number | No |
w.memoryEstimateConfidence | Memory Estimate Confidence condition | String | Yes |
w.memoryRequiredMB |
Memory required condition (in MB but maps to
memory_required_bytes in sys.query ) |
Number | Yes |
w.movable | Movable query condition | Boolean | Yes |
w.moveToResourcePool(w.resourcePool, w.allowMoveToSamePool) | Move Query to New Resource Pool action Moves a query to a different
resource pool, or to the same pool if the second argument is
|
String | N/A |
w.namespace | Schema condition | String | Yes |
w.numRestartError |
Number of restarts on error (num_error in
sys.query ) |
Number | Yes |
w.numRestartUser |
Number of restarts by user (num_restart in
sys.query ) |
Number | Yes |
w.priority | Priority condition or action | String | No |
w.referencedTables | Referenced Tables condition | String (list) | Yes |
w.requestedMemoryMB | Set Requested Memory action (in MB) | Number | No |
w.requestedMemoryPercent | Set Requested Memory action (as a percentage) | Number | No |
w.requestedSpillMB | Set Requested Temp Space action (in MB) | Number | No |
w.requestedSpillPercent | Set Requested Temp Space action (as a percentage) | Number | No |
w.resourcePool | Resource Pool condition or action. See also Setting and Matching Resource Pools in WLM Rules. | String | No |
w.restartable | Restartable query condition | Boolean | Yes |
w.restartInResourcePool(w.resourcePool, w.allowRestartInSamePool) | Restart Query in Resource Pool action Restarts a query in a different
resource pool, or in the same pool if the second argument is
|
String, Boolean | N/A |
w.roles | User Roles condition | String | Yes |
w.sessionId |
Session ID condition | Number | |
w.setTimeout(function () ..., timeoutMs) |
Timeout condition (specifies a timeoutMs delay on the body
of the rule) |
String, Number | |
w.singleWorker | Single Worker query condition | Boolean | Yes |
w.SQLText | SQL condition | String | Yes |
w.stats.AvgCpu |
Average CPU across cluster | Number | Yes |
w.stats.bytesNetwork | Bytes Network condition | Number | Yes |
w.stats.bytesRead | Bytes Read condition | Number | Yes |
w.stats.BytesReadClient |
Bytes Read by Client condition | Number | Yes |
w.stats.BytesWriteClient |
Bytes Sent by Client condition | Number | Yes |
w.stats.bytesReadSpill | Temporary Bytes Read condition | Number | Yes |
w.stats.bytesWrite | Bytes Written condition | Number | Yes |
w.stats.bytesWriteSpill | Temporary Bytes Written condition | Number | Yes |
w.stats.cpu |
CPU percent usage on longest worker (cpu_percent in
sys.query ) |
Number | Yes |
w.stats.longestWorker |
Longest worker condition | String (UUID) | Yes |
w.stats.maxCpu |
CPU percent usage of max worker (cpu_percent_max in
sys.query ) |
Yes | |
w.stats.memory |
Memory condition (on longest worker, memory_bytes in
sys.query ) |
Number | Yes |
w.stats.maxMemory | Max Memory condition | Number | Yes |
w.stats.rowsDeleted | Rows Deleted condition | Number | Yes |
w.stats.rowsInserted | Rows Inserted condition | Number | Yes |
w.stats.rowsReturned | Rows Returned condition | Number | Yes |
w.statsStored | Store Execution Statistics action and condition | Boolean | Yes |
w.superUser |
Superuser condition (superuser column in
sys.user and sys.role ) |
Boolean | Yes |
w.tags | Set Query Tags action or condition | String | No |
w.transactionId |
Transaction ID condition (transaction_id in
sys.query ) |
Number | Yes |
w.type | Type condition (type of query) | String | Yes |
w.user | User Name condition | String | Yes |
w.userId |
User ID condition | String | Yes |
w.workstation |
Workstation condition, where this value corresponds to
client_ip_address in the sys.log_session and
sys.log_session views. |
String | Yes |
wlm.assignMaximumResources |
Action to assign the maximum available resources in a pool. See Default Error Recovery. | Boolean | N/A |
wlm.assignMostConcurrentPool
wlm.assignMostConcurrentPoolWithTempSpace
wlm.assignMostConcurrentPoolWithoutTempSpace
wlm.assignSmallestPoolForMemoryassignLargestMemoryPool
wlm.assignLargestMemoryPoolWithTempSpace
wlm.assignLargestMemoryPoolWithoutTempSpace wlm.assignLargestTempSpacePool
wlm.assignLeastBusyPool |
Actions to assign resource pools. These actions take no parameters. | N/A | N/A |
wlm.throttle(max, barrierName) | Limit Concurrent Queries action (maximum number, name of "barrier," such as a user, role, or application) | Number, String | No |