Get Reflection Dataset with REST API

Is there a rest API to get a reflection’s dataset result? I know you can run a query with /sql endpoint and then hit /job/{id} for status, and then /job/{id}/results for results, but it would be nice to hit a reflection dataset directly.

Thanks,
Sam Morgan.

To find all reflections in RUNNING state for than 30 minutes, use below SQL either via JDBC or POST SQL

SELECT m., r. from sys.materializations m, sys.reflections r
where m.state = ‘RUNNING’
and m.reflection_id = r.reflection_id
and r.dataset like ‘%trips-conditions-limit%’
and now() >= date_add(m.“create”, INTERVAL ‘30’ MINUTE)

  1. The above query will also get you the JOB ID’s of these refresh jobs,

API Call: GET JOB ID

http://localhost:9047/api/v3/job/<JOB_ID>

Sample output:

{
“jobState”: “RUNNING”,
“rowCount”: 0,
“errorMessage”: “”,
“startedAt”: “2020-06-15T05:04:00.155Z”,
“queryType”: “ACCELERATOR_CREATE”,
“queueName”: “High Cost Reflections”,
“queueId”: “158a156a-2efd-4fc5-83c5-3b6c190badfb”,
“resourceSchedulingStartedAt”: “2020-06-15T05:04:00.225Z”,
“resourceSchedulingEndedAt”: “2020-06-15T05:04:00.277Z”,
“cancellationReason”: “”
}