Run Query from another notebook in streaming job
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2023 05:34 AM
Hi!
We want to run query located in another notebook every streaming microbatch.
We were trying dbutils.run.notebook but we always get error
Context not valid. If you are calling this outside the main thread, you must set the Notebook context via dbutils.notebook.setContext(ctx), where ctx is a value retrieved from the main thread (and the same cell) via dbutils.notebook.getContext().
We tried to do what is mentioned in command, but it still doesn't seem to work.
We decided to test using old command execution API, but I am not able to get the status of command using
'error_code': 'INVALID_PARAMETER_VALUE', 'message': 'Cluster id cannot be null', 'error': 'DatabricksServiceException: INVALID_PARAMETER_VALUE: Cluster id cannot be null'
however I am providing cluster id.
Maybe there are other options of running query from external notebook?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2023 04:28 AM
Query Parameters means that you have to pass all parameters as a part of URL after question mark not in the body
"/api/1.2/commands/status?clusterId=$cid&contextId=$ec_id&commandId=$command_id"

