How does one check the status of jobs currently running via the api without knowing the job id? The problem I am trying to solve: I can trigger acceleration refreshes when underlying sources are ready via the api, but i don’t have a way to know when they are done so that my other process that connect to Dremio can start.
When triggering a manual refresh using the REST API, there is currently no way to get the job ids for the refreshes. The main reason is that reflections can be chained so multiple jobs need to be run (in succession) and we currently do not have a way using the REST API to monitor the progress of these refresh chains.
It is something we want to provide but there isn’t a concrete timeline for it.
-- ver reflections activadas y su estado
select *
from sys.reflections r
where r.status <> 'DISABLED';
-- ver tiempo total de reflections del dia actual
select *
from sys.refreshes r
where cast(job_start as date) = current_date ;
-- ver tiempo total acumulado de últimas refresh reflections
SELECT SUM(dur)
FROM (
SELECT r.reflection_id,r.job_start,r.job_end, TIMESTAMPDIFF(SECOND,r.job_start,r.job_end) as dur,
row_number() OVER (PARTITION BY r.reflection_id ORDER BY job_start DESC) AS rn
FROM sys.refreshes r
)
WHERE rn = 1;
-- ver tiempo total de intervalo entre inicio y fin de refresh reflections
SELECT MIN("job_start"),MAX(job_end),TIMESTAMPDIFF(SECOND, MIN("job_start"),MAX(job_end))
FROM (
SELECT r.reflection_id,r.job_start,r.job_end, TIMESTAMPDIFF(SECOND,r.job_end,r.job_start) as dur,
row_number() OVER (PARTITION BY r.reflection_id ORDER BY job_start DESC) AS rn
FROM sys.refreshes r
)
WHERE rn = 1;
-- others
select * from sys.materializations;
select * FROM sys.refreshes r;