Get scheduled query information and monitor the query
After you create a scheduled query you can access information about it in the
scheduled_queries table of the Hive information schema. You can also
use the information schema to monitor scheduled query execution.
Query the information schema to get information about a schedule.
SELECT * FROM information_schema.scheduled_queries WHERE schedule_name = 'scheduled_rebuild';The following information appears about the scheduled query:
- Unique numeric identifier for a scheduled query.
- Name of the scheduled query.
- Whether the scheduled query is currently enabled or not.
- Namespace that the scheduled query belongs to.
- Schedule described as a Quartz cron expression.
- Owner of the scheduled query.
- SQL query to be executed.
- When the next execution of this scheduled query is due.
Monitor the most recent scheduled query execution.
SELECT * FROM information_schema.scheduled_executions;You can configure the retention period for this information in the Hive metastore.
- Unique numeric identifier for a scheduled query execution.
- Name of the scheduled query associated with this execution.
- Query ID assigned to the execution by HiveServer (HS2).
- One of the following phases of execution.
- STARTED. A scheduled query is due and a HiveServer instance has retrieved its information.
- EXECUTING. HiveServer is executing the query and reporting progress in configurable intervals.
- FAILED. The query execution was stopped due to an error or exception.
- FINISHED. The query execution was successful.
- TIMED_OUT. HiveServer did not provide an update on the query status for more than a configurable timeout.
- Start time of execution.
- End time of execution.
- Difference between start and end time.
- If the scheduled query failed, it contains the error message associated with its failure.
- Time of the last update of the query status by HiveServer.