Any Databricks system tables contain info of the saved/pre-defined queries
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2024 08:12 AM
How can I find the saved/pre-defined queries in Databricks system tables?
system.query.history seems NOT having the info, like query-id or query-name
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2024 05:56 AM
Hi Bryan, Databricks system tables do not store saved queries. Query history table captures the query execution details, including:
- Statement ID
- Execution status
- User who ran the query
- Statement text (if not encrypted)
- Statement type
- Execution duration
- Resource usage
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2024 06:34 AM
How can we retrieve the information from the "query history table" and present it in our own dashboard/widget?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2024 07:47 AM
Hi Bryan, Depending on the information you want to retrieve, you can write queries and showcase that in a dashboard. Please see these links for sample query and dashboard.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2024 08:39 AM
That did not address the requirement to show the saved/pre-defined queries in our own dashboard, while the saved/pre-defined queries cannot be identified from system.query.history
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2024 09:00 AM
Hi Bryan, As I mentioned in the previous thread, query history doesn't store saved query information. There is no out of the box feature which can showcase saved query in the dashboard. For accessing saved query you can follow these methods.
- Workspace UI: You can view and manage saved queries by clicking on "Workspace" or "Queries" in the sidebar.
- Workspace Browser: Queries can be organized into folders along with other Databricks objects in the workspace browser.
- API and Connectors: You can create and manage queries using the REST API, JDBC/ODBC connectors, or partner tools without using the Databricks UI.
Please see this link https://learn.microsoft.com/en-us/azure/databricks/sql/user/queries/

