Skip to content

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 Yellowbrick Manager.

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).

NameDescriptionData TypeRead-only
w.abort or w.abortReasonAbort Query action (cancel query and return a reason message)StringNo
w.allowSQBSet Short Query Bias action (or a condition)BooleanNo
w.applicationApplication conditionStringNo
w.authenticatedUsernameCondition on the user account that originates the session. If SET ROLE is used, this value does not change.StringYes
w.commandCommand conditionStringYes
w.costCost conditionNumberYes
w.currentStateCurrent 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).StringYes
w.databaseDatabase conditionStringYes
w.duration or w.elapsedTimeTotal Duration condition. (w.duration and w.elapsedTime are synonyms.)NumberYes
w.errorCodeError Code conditionStringYes
w.errorMessageError Message conditionStringYes
w.errorRecoverableRecoverable Error condition; whether the query can be restarted on error (defined as part of the default error recovery policy).BooleanNo
w.execIdExecution ID condition (where execution ID is the same value as a query_id in sys.query)NumberYes
w.executionDurationExecution Duration conditionNumberYes
w.explainAnalyzeEXPLAIN ANALYZE condition (whether the query is an EXPLAIN ANALYZE command)BooleanYes
log.debug, log.error, log.info, log.warnAction to log messages at different levelsStringYes
w.lookupSet Lookup Query action; also a conditionBooleanNo
w.maximumExecTimeLimitSet Maximum Execution Time Limit actionNumberNo
w.maximumRowLimitSet Maximum Row Limit actionNumberNo
w.maximumWaitLimitSet Maximum Wait Limit actionNumberNo
w.memoryEstimateMemory Estimate condition (value in MB, but equivalent to memory_estimated_bytes in sys.query)NumberNo
w.memoryEstimateConfidenceMemory Estimate Confidence conditionStringYes
w.memoryRequiredMBMemory required condition (in MB but maps to memory_required_bytes in sys.query)NumberYes
w.movableMovable query conditionBooleanYes
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 true (it is false by default).

StringN/A
w.namespaceSchema conditionStringYes
w.numRestartErrorNumber of restarts on error (num_error in sys.query)NumberYes
w.numRestartUserNumber of restarts by user (num_restart in sys.query)NumberYes
w.priorityPriority condition or actionStringNo
w.referencedTablesReferenced Tables conditionString (list)Yes
w.requestedMemoryMBSet Requested Memory action (in MB)NumberNo
w.requestedMemoryPercentSet Requested Memory action (as a percentage)NumberNo
w.requestedSpillMBSet Requested Temp Space action (in MB)NumberNo
w.requestedSpillPercentSet Requested Temp Space action (as a percentage)NumberNo
w.resourcePoolResource Pool condition or action. See also Setting and Matching Resource Pools in WLM Rules.StringNo
w.restartableRestartable query conditionBooleanYes
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 true (it is false by default).

String, BooleanN/A
w.rolesUser Roles conditionStringYes
w.sessionIdSession ID conditionNumber
w.setTimeout(function () ..., timeoutMs)Timeout condition (specifies a timeoutMs delay on the body of the rule)String, Number
w.singleWorkerSingle Worker query conditionBooleanYes
w.SQLTextSQL conditionStringYes
w.stats.AvgCpuAverage CPU across clusterNumberYes
w.stats.bytesNetworkBytes Network conditionNumberYes
w.stats.bytesReadBytes Read conditionNumberYes
w.stats.BytesReadClientBytes Read by Client conditionNumberYes
w.stats.BytesWriteClientBytes Sent by Client conditionNumberYes
w.stats.bytesReadSpillTemporary Bytes Read conditionNumberYes
w.stats.bytesWriteBytes Written conditionNumberYes
w.stats.bytesWriteSpillTemporary Bytes Written conditionNumberYes
w.stats.cpuCPU percent usage on longest worker (cpu_percent in sys.query)NumberYes
w.stats.longestWorkerLongest worker conditionString (UUID)Yes
w.stats.maxCpuCPU percent usage of max worker (cpu_percent_max in sys.query)Yes
w.stats.memoryMemory condition (on longest worker, memory_bytes in sys.query)NumberYes
w.stats.maxMemoryMax Memory conditionNumberYes
w.stats.rowsDeletedRows Deleted conditionNumberYes
w.stats.rowsInsertedRows Inserted conditionNumberYes
w.stats.rowsReturnedRows Returned conditionNumberYes
w.statsStoredStore Execution Statistics action and conditionBooleanYes
w.superUserSuperuser condition (superuser column in sys.user and sys.role)BooleanYes
w.tagsSet Query Tags action or conditionStringNo
w.transactionIdTransaction ID condition (transaction_id in sys.query)NumberYes
w.typeType condition (type of query)StringYes
w.userUser Name conditionStringYes
w.userIdUser ID conditionStringYes
w.workstationWorkstation condition, where this value corresponds to client_ip_address in the sys.log_session and sys.log_session views.StringYes
wlm.assignMaximumResourcesAction to assign the maximum available resources in a pool. See Default Error Recovery.BooleanN/A
wlm.assignMostConcurrentPool wlm.assignMostConcurrentPoolWithTempSpace wlm.assignMostConcurrentPoolWithoutTempSpace wlm.assignSmallestPoolForMemoryassignLargestMemoryPool wlm.assignLargestMemoryPoolWithTempSpace wlm.assignLargestMemoryPoolWithoutTempSpace wlm.assignLargestTempSpacePool wlm.assignLeastBusyPoolActions to assign resource pools. These actions take no parameters.N/AN/A
wlm.throttle(max, barrierName)Limit Concurrent Queries action (maximum number, name of "barrier," such as a user, role, or application)Number, StringNo