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

Canceling a (long-running) query #29

Open
henningsway opened this issue Sep 18, 2018 · 3 comments
Open

Canceling a (long-running) query #29

henningsway opened this issue Sep 18, 2018 · 3 comments

Comments

@henningsway
Copy link

henningsway commented Sep 18, 2018

I use the implyr-package frequently. Sometimes I realize only after I have sent a query, that it will take (too) long to take the results.

I havent yet found the best way to cancel a query. The Stop-button in Rstudio doesn't do the trick, same with Ctrc-c. I sometimes terminate Rstudio or Rstudio Server, if a query takes too long.

What are the mechanics that make it difficult to cancel a query? What approach would you suggest?

@henningsway henningsway changed the title improve ways to cancel a (long-running) query Canceling a (long-running) query Sep 18, 2018
@ianmcook
Copy link
Owner

Thanks for asking about this. Cancelling queries is a tricky problem because of how the stack of packages that support implyr works. The odbc package, for example, runs C++ code that can't or doesn't check for interrupts from R.

There are possible workarounds for this, for example, we could implement an alternative version of the collect() function that would work asynchronously and would check often for interrupts or cancel commands.

Do these long waits typically happen after you've executed a collect() command? Or in some other situation?

@henningsway
Copy link
Author

henningsway commented Sep 21, 2018

It depends. It does often happen after I sent a collect(), but also , when I work with a remote tbl, want to see the output of some sql-transformations and underestimated the time the computation of the preview takes. ;-)

I would guess that both cases happen about equally often. (Though for the second one, I could also try to develop on much smaller subset more often.)

@henningsway
Copy link
Author

I think something similar has been implemented for sparklyr recently: https://blog.rstudio.com/2018/10/01/sparklyr-0-9/

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

No branches or pull requests

2 participants