Scheduler.Job

Type

Read/write

Author

Availability

Data provider

Read

Finbourne

Provided with LUSID

The Scheduler.Job provider enables you to write a Luminesce SQL query that retrieves job data from Scheduler.

Note: The LUSID user running the query must have sufficient access control permissions to both use the provider and read Scheduler job data. This should automatically be the case if you are the domain owner.

See also: Scheduler.Job.History, Scheduler.Job.HistoryWithLogs, Scheduler.Job.Run

select * from Scheduler.Job where <filter-expression>;
SQL

Scheduler.Job has parameters that enable you to filter or refine a query.

To list available parameters, their data types, default values, and an explanation for each, run the following query using a suitable tool:

select FieldName, DataType, ParamDefaultValue, Description from Sys.Field where TableName = 'Scheduler.Job' and FieldType = 'Parameter';
SQL

By default, Scheduler.Job returns a table of data populated with particular fields (columns). You can return a subset of these fields.

To list fields available to return, their data types, whether fields are considered 'main', and an explanation for each, run the following query using a suitable tool:

select FieldName, DataType, IsMain, IsPrimaryKey, SampleValues, Description from Sys.Field where TableName = 'Scheduler.Job' and FieldType = 'Column';
SQL

Note: Fields marked 'main' are returned by queries that include a caret character, for example select ^ from Scheduler.Job.

Note: For more example Luminesce SQL queries, visit our Github repo.

select * from Scheduler.Job limit 10
SQL
select * from Scheduler.Job where JobScope = 'transactions' and JobCode = 'upsert-transactions'
SQL
select * from Scheduler.Job where DockerImage like '%lusid-upsert-transactions-image:%'
SQL
select * from Scheduler.Job where Author = 'Joe Bloggs'
SQL

In this example, Scheduler.Job is joined with Scheduler.Job.HistoryWithLogs to retrieve all console output logs for failed jobs within a particular scope. 

select * 
from Scheduler.Job j
join Scheduler.Job.HistoryWithLogs h
  on j.JobScope = h.JobScope
  and j.JobCode = h.JobCode
where h.JobStatus = 'Failed'
and j.JobScope = 'transactions'
SQL