Fail a job
Marks a job as failed with a message and optional diagnostic value. It is a no-op for a job already in a
terminal state (completed, cancelled, failed); a pending_cancellation job can still be failed if it fails
before the cancellation is processed.
Requires write access to jobs.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Unique identifier for a job.
Body
Response
OK
Unique identifier for the job.
The data plane the job runs on.
{
"type": "api_user",
"company_id": 1,
"user_id": 1248
}failed, cancelled, completed, pending, pending_cancellation, running The type associated with the job. Jobs can have a type of nql-forecast or materialize-view.
- Option 1
- Option 2
{
"nql": "CREATE MATERIALIZED VIEW \"sampleNQL\" as WITH OrderedData AS (\n SELECT\n \"mobile_id_unique_identifier\".\"value\" AS mobile_id,\n \"timestamp_object\".\"day\",\n \"timestamp_object\".\"hour\",\n \"geographic_location\".\"latitude\",\n \"geographic_location\".\"longitude\",\n \"event_timestamp\",\n LAG(\"event_timestamp\", 1) OVER (PARTITION BY \"mobile_id_unique_identifier\".\"value\", \"geographic_location\".\"latitude\", \"geographic_location\".\"longitude\" ORDER BY \"event_timestamp\") AS prev_timestamp\n FROM\n \"company_data\".\"6402\"\n WHERE\n \"mobile_id_unique_identifier\".\"value\" IS NOT NULL \n), \nContinuousPresence AS (\n SELECT\n mobile_id,\n \"day\",\n \"hour\",\n latitude,\n longitude,\n event_timestamp,\n prev_timestamp,\n CASE\n WHEN extract(minute FROM event_timestamp) - extract(minute FROM prev_timestamp) BETWEEN 40 AND 120 THEN 1\n ELSE 0\n END AS is_continuous\n FROM\n OrderedData\n)\nSELECT\n mobile_id,\n \"day\",\n \"hour\",\n latitude,\n longitude\nFROM\n ContinuousPresence\nWHERE\n is_continuous = 1\nGROUP BY\n mobile_id,\n \"day\",\n \"hour\",\n latitude,\n longitude\n",
"dataset_id": 6404,
"stats_enabled": true,
"compiled_sql": "SELECT\n `t`.`mobile_id`,\n `t`.`day`,\n `t`.`hour`,\n `t`.`latitude`,\n `t`.`longitude`\nFROM\n (SELECT\n `ds_6402`.`mobile_id_unique_identifier`['value'] `mobile_id`,\n `ds_6402`.`timestamp_object`['day'] `day`,\n `ds_6402`.`timestamp_object`['hour'] `hour`,\n `ds_6402`.`geographic_location`['latitude'] `latitude`,\n `ds_6402`.`geographic_location`['longitude'] `longitude`,\n CASE\n WHEN EXTRACT(MINUTE FROM `ds_6402`.`event_timestamp`) - EXTRACT(MINUTE FROM LAG(`ds_6402`.`event_timestamp`, 1) OVER (\n PARTITION BY `ds_6402`.`mobile_id_unique_identifier`.`value`, `ds_6402`.`geographic_location`.`latitude`, `ds_6402`.`geographic_location`.`longitude`\n ORDER BY `ds_6402`.`event_timestamp` NULLS LAST)) >= 40 AND EXTRACT(MINUTE FROM `ds_6402`.`event_timestamp`) - EXTRACT(MINUTE FROM LAG(`ds_6402`.`event_timestamp`, 1) OVER (\n PARTITION BY `ds_6402`.`mobile_id_unique_identifier`.`value`, `ds_6402`.`geographic_location`.`latitude`, `ds_6402`.`geographic_location`.`longitude`\n ORDER BY `ds_6402`.`event_timestamp` NULLS LAST)) <= 120\n THEN 1\n ELSE 0\n END `is_continuous`\n FROM\n narrative.datasets.ds_6402 `ds_6402`) `t`\nWHERE\n `t`.`is_continuous` = 1\nGROUP BY\n `t`.`mobile_id`,\n `t`.`day`,\n `t`.`hour`,\n `t`.`latitude`,\n `t`.`longitude`"
}The internal job executor tied to the job.
causes of job failure
The unique ID associated with the job.
The output of a materialized view.
- Option 1
- Option 2
{
"dataset_id": 6404,
"snapshot_id": 739881302291276700,
"recalculation_id": "abf9a2ec-426b-4751-bd16-fcb435061925"
}The timestamp representing when the job was created.
The timestamp representing when the job was updated.
The timestamp representing when the job finished.
The compute pool associated with the job, if any.
The type of the execution cluster to run the job on.
dedicatedruns job on a dedicated cluster.sharedruns job on a shared cluster.
dedicated, shared 
