How can I set up a schedule for a query in Databricks and share it with other users, ensuring they can view the results of the scheduled runs?
1. In the Query Editor, click on "Schedule" and then "Add schedule" to open the menu with schedule settings.
2. Choose when to run the query by using the dropdown pickers to specify the frequency, period, starting time, and time zone. Optionally, select the "Show cron syntax" checkbox to edit the schedule in Quartz Cron Syntax.
3. To set optional settings, click on "More options". Here, you can choose a name for the schedule and a SQL warehouse to power the query.
4. Click on "Create". Your query will now run automatically according to the schedule.
5. To share the schedule with other users, click on "Schedule(#)", then click on the kebab menu and select "Edit schedule permissions".
6. Choose a user or group from the drop-down menu in the dialog and select "CAN VIEW" to allow the selected users to view the results of scheduled runs.

Note: Query permissions are not linked to schedule permissions. After creating your scheduled run interval, edit the schedule permissions to provide access to other users. Also, when a query is “Run as Owner” and a schedule is added, the query owner’s credential is used for execution, and anyone with at least CAN RUN sees the results of those refreshed queries. When a query is “Run as Viewer” and a schedule is added, the schedule owner’s credential is used for execution. Only the users with appropriate schedule permissions see the results of the refreshed queries; all other viewers must manually refresh to see updated query results.