w.query_history
: Query History¶
- class databricks.sdk.service.sql.QueryHistoryAPI¶
Access the history of queries through SQL warehouses.
- list([, filter_by: Optional[QueryFilter], include_metrics: Optional[bool], max_results: Optional[int], page_token: Optional[str]]) Iterator[QueryInfo] ¶
Usage:
from databricks.sdk import WorkspaceClient from databricks.sdk.service import sql w = WorkspaceClient() _ = w.query_history.list(filter_by=sql.QueryFilter( query_start_time_range=sql.TimeRange(start_time_ms=1690243200000, end_time_ms=1690329600000)))
List Queries.
List the history of queries through SQL warehouses.
You can filter by user ID, warehouse ID, status, and time range.
- Parameters:
filter_by –
QueryFilter
(optional) A filter to limit query history results. This field is optional.include_metrics – bool (optional) Whether to include metrics about query.
max_results – int (optional) Limit the number of results returned in one page. The default is 100.
page_token – str (optional) A token that can be used to get the next page of results. The token can contains characters that need to be encoded before using it in a URL. For example, the character ‘+’ needs to be replaced by %2B.
- Returns:
Iterator over
QueryInfo