-
Notifications
You must be signed in to change notification settings - Fork 174
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
Name collision in compute(temporary = FALSE)
#1154
Comments
I prefer option 2, even though it is a breaking change. |
Most temporary tables are session specific. What databases is in use here? |
@hadley The title is misleading here. As I understand it, the issue is about |
compute(temporary = FALSE)
Oooh, got it. In that case, option two sounds right to me. To avoid breaking existing code, we could start by making this a warning, rather than an error. |
By default, calling
compute
creates a table with name "dbplyr_n". Although temporary tables are isolated between sessions, if a user calls temporary = FALSE without explicitly setting a name, then the table is persisted using the dbplyr_ name. Other users using dbplyr on the same database can then experience collisions when callingcompute
as the generated table name already exists. Best practice would be to avoid persisting these temp tables without specifying a name, but it can happen.Possible solutions:
Option 1 relies on the user to set the option, and they could still potentially collide with their own tables.
Option 2 should stop the problem at the root, but would be a breaking change.
Option 3 is undesirable IMO due to extra call to DB, and theoretically could result in many calls if all generated names were taken.
Option 4 would be a reasonable solution and miniscule probability of collisions
The text was updated successfully, but these errors were encountered: