Job Results
Use the Job API to retrieve results for a specific job.
Job Results Object{
"rowCount": 11,
"schema": [
{
"name": "pickup_datetime",
"type": {
"name": "TIMESTAMP"
}
},
{
"name": "passenger_count",
"type": {
"name": "BIGINT"
}
},
{
"name": "trip_distance_mi",
"type": {
"name": "DOUBLE"
}
},
{
"name": "fare_amount",
"type": {
"name": "DOUBLE"
}
},
{
"name": "tip_amount",
"type": {
"name": "DOUBLE"
}
},
{
"name": "total_amount",
"type": {
"name": "DOUBLE"
}
}
],
"rows": [
{
"pickup_datetime": "2013-02-10 20:00:00.000",
"passenger_count": 9,
"trip_distance_mi": 3,
"fare_amount": 10,
"tip_amount": 3,
"total_amount": 13
},
{
"pickup_datetime": "2013-05-27 19:15:00.000",
"passenger_count": 1,
"trip_distance_mi": 1.26,
"fare_amount": 7.5,
"tip_amount": 0,
"total_amount": 8
},
{
"pickup_datetime": "2013-05-31 16:40:00.000",
"passenger_count": 1,
"trip_distance_mi": 0.73,
"fare_amount": 5,
"tip_amount": 1.2,
"total_amount": 7.7
},
{
"pickup_datetime": "2013-05-27 19:03:00.000",
"passenger_count": 2,
"trip_distance_mi": 9.23,
"fare_amount": 27.5,
"tip_amount": 5,
"total_amount": 38.33
},
{
"pickup_datetime": "2013-05-31 16:24:00.000",
"passenger_count": 1,
"trip_distance_mi": 2.27,
"fare_amount": 12,
"tip_amount": 0,
"total_amount": 13.5
},
{
"pickup_datetime": "2013-05-27 19:17:00.000",
"passenger_count": 1,
"trip_distance_mi": 0.71,
"fare_amount": 5,
"tip_amount": 0,
"total_amount": 5.5
},
{
"pickup_datetime": "2013-05-27 19:11:00.000",
"passenger_count": 1,
"trip_distance_mi": 2.52,
"fare_amount": 10.5,
"tip_amount": 3.15,
"total_amount": 14.15
},
{
"pickup_datetime": "2013-05-31 16:41:00.000",
"passenger_count": 5,
"trip_distance_mi": 1.01,
"fare_amount": 6,
"tip_amount": 1.1,
"total_amount": 8.6
},
{
"pickup_datetime": "2013-05-31 16:37:00.000",
"passenger_count": 1,
"trip_distance_mi": 1.25,
"fare_amount": 8.5,
"tip_amount": 0,
"total_amount": 10
},
{
"pickup_datetime": "2013-05-31 16:39:00.000",
"passenger_count": 1,
"trip_distance_mi": 2.04,
"fare_amount": 10,
"tip_amount": 1.5,
"total_amount": 13
},
{
"pickup_datetime": "2013-05-27 19:02:00.000",
"passenger_count": 1,
"trip_distance_mi": 11.73,
"fare_amount": 32.5,
"tip_amount": 8.12,
"total_amount": 41.12
}
]
}
Job Results Attributes
rowCount Integer
The number of rows returned by the job.
schema Array of Objects
An array of schema definitions for the data returned by the job.
rows Array of Objects
An array of data returned by the job for each row of results.
Retrieve Job Results
Method and URLGET /v0/projects/{project_id}/job/{id}/results
Parameters
project_id Path String (UUID)
id Path String (UUID)
UUID for the job to retrieve. Get the job ID from responses to SQL API requests.
limit Query Integer Optional
The number of rows to retrieve. The maximum valid value is 500. The default is 100. Use with the offset query parameter to paginate and retrieve more than the first 500 results. See the limit query parameter for more information.
offset Query Integer Optional
The number of rows to skip for pagination. The default is 0. See the offset query parameter for more information.
Examples
Requestcurl -X GET "https://api.dremio.cloud/v0/projects/$PROJECT_ID/job/$JOB_ID/results" \
-H "Authorization: Bearer $DREMIO_TOKEN" \
-H 'Content-Type: application/json'
{
"rowCount": 11,
"schema": [
{
"name": "pickup_datetime",
"type": {
"name": "TIMESTAMP"
}
},
{
"name": "passenger_count",
"type": {
"name": "BIGINT"
}
},
{
"name": "trip_distance_mi",
"type": {
"name": "DOUBLE"
}
},
{
"name": "fare_amount",
"type": {
"name": "DOUBLE"
}
},
{
"name": "tip_amount",
"type": {
"name": "DOUBLE"
}
},
{
"name": "total_amount",
"type": {
"name": "DOUBLE"
}
}
],
"rows": [
{
"pickup_datetime": "2013-02-10 20:00:00.000",
"passenger_count": 9,
"trip_distance_mi": 3,
"fare_amount": 10,
"tip_amount": 3,
"total_amount": 13
},
{
"pickup_datetime": "2013-05-27 19:15:00.000",
"passenger_count": 1,
"trip_distance_mi": 1.26,
"fare_amount": 7.5,
"tip_amount": 0,
"total_amount": 8
},
{
"pickup_datetime": "2013-05-31 16:40:00.000",
"passenger_count": 1,
"trip_distance_mi": 0.73,
"fare_amount": 5,
"tip_amount": 1.2,
"total_amount": 7.7
},
{
"pickup_datetime": "2013-05-27 19:03:00.000",
"passenger_count": 2,
"trip_distance_mi": 9.23,
"fare_amount": 27.5,
"tip_amount": 5,
"total_amount": 38.33
},
{
"pickup_datetime": "2013-05-31 16:24:00.000",
"passenger_count": 1,
"trip_distance_mi": 2.27,
"fare_amount": 12,
"tip_amount": 0,
"total_amount": 13.5
},
{
"pickup_datetime": "2013-05-27 19:17:00.000",
"passenger_count": 1,
"trip_distance_mi": 0.71,
"fare_amount": 5,
"tip_amount": 0,
"total_amount": 5.5
},
{
"pickup_datetime": "2013-05-27 19:11:00.000",
"passenger_count": 1,
"trip_distance_mi": 2.52,
"fare_amount": 10.5,
"tip_amount": 3.15,
"total_amount": 14.15
},
{
"pickup_datetime": "2013-05-31 16:41:00.000",
"passenger_count": 5,
"trip_distance_mi": 1.01,
"fare_amount": 6,
"tip_amount": 1.1,
"total_amount": 8.6
},
{
"pickup_datetime": "2013-05-31 16:37:00.000",
"passenger_count": 1,
"trip_distance_mi": 1.25,
"fare_amount": 8.5,
"tip_amount": 0,
"total_amount": 10
},
{
"pickup_datetime": "2013-05-31 16:39:00.000",
"passenger_count": 1,
"trip_distance_mi": 2.04,
"fare_amount": 10,
"tip_amount": 1.5,
"total_amount": 13
},
{
"pickup_datetime": "2013-05-27 19:02:00.000",
"passenger_count": 1,
"trip_distance_mi": 11.73,
"fare_amount": 32.5,
"tip_amount": 8.12,
"total_amount": 41.12
}
]
}
For jobs with a jobState value other than COMPLETED, the response includes an error message instead of the job results object. The job's status is listed inside brackets in the error message (CANCELED, FAILED, or RUNNING).
{
"errorMessage": "Cannot fetch details for a job that is in [FAILED] state.",
"moreInfo": ""
}
Response Status Codes
200 OK
400 Bad Request
403 Forbidden
404 Not Found