Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PECO-1263] Add documentation for execute_async #322

Open
wants to merge 6 commits into
base: peco-1263-staging
Choose a base branch
from

Conversation

susodapop
Copy link
Contributor

@susodapop susodapop commented Jan 20, 2024

Note for reviewers: Please review this after reviewing #325.

Description

This pull request adds documentation for the forthcoming execute_async() feature. It describes the interface and gives some usage examples.

Jesse Whitehouse added 4 commits January 19, 2024 20:43
…UID."

This reverts commit 1c58313.

Signed-off-by: Jesse Whitehouse <[email protected]>
Update changelog.

Signed-off-by: Jesse Whitehouse <[email protected]>
Signed-off-by: Jesse Whitehouse <[email protected]>
@susodapop susodapop marked this pull request as ready for review January 22, 2024 20:57
Jesse Whitehouse added 2 commits January 22, 2024 16:55
Signed-off-by: Jesse Whitehouse <[email protected]>
@dhirschfeld
Copy link
Contributor

Does this method have particular benefits over just running a blocking call in a thread?

@susodapop
Copy link
Contributor Author

Yes, the benefit is to recover a running execution. Imagine you are running a long query (1+ hour) and in the middle, your network cable comes unplugged or your computer runs out of battery. The query continues running on your cluster (incurring cost) but you have no way to recover it or see its results. You can cancel it from the Databricks SQL web UI but apart from that you have no choice but to re-run it and wait another hour for results.

In a second usage scenario, if you deploy the connector in a serverless function or lambda. You can wake the lambda to begin executing the query, commit its handle to state, sleep the lambda for some period of time, and wake up to fetch the results. This isn't possible using threads.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants