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

File error (Out of disk space) during bq_table_download #343

Closed
mr2dark opened this issue Aug 12, 2019 · 2 comments
Closed

File error (Out of disk space) during bq_table_download #343

mr2dark opened this issue Aug 12, 2019 · 2 comments
Labels
download ⬇️ feature a feature request or enhancement

Comments

@mr2dark
Copy link

mr2dark commented Aug 12, 2019

I would like to run an R script which uses bigrquery to run a query to BQ and download results within an AWS Fargate task which is rather disk space constrained. There are a lot of data and when I run that script it eventually fails with the following lines in logs:

Error in file(path, open = "wb") : cannot open the connection
Calls: <Anonymous> ... bq_download_pages -> <Anonymous> -> <Anonymous> -> file
In addition: There were 50 or more warnings (use warnings() to see the first 50)

I assume that the cause of the problem is in the fact that bq_download_pages creates a set of temporary files which aren't removed after being parsed.
As a workaround (rather nasty) I do the following after a call to bq_download_pages:

# A workaround cleanup until https://github.com/r-dbi/bigrquery/issues/343 is fixed
do.call(file.remove, list(list.files(tempdir(), pattern = 'bq-[[:xdigit:]]+\\.json', full.names = TRUE)))

But I believe the proper solution will be adding before the final line of bq_download_pages the following line:

do.call(file.remove, page_paths)
@meztez
Copy link
Contributor

meztez commented Mar 11, 2020

The file haven't been parsed at this point, files are parsed inside bq_table_download, one solution would be to add it after

convert_bigint(table_data, bigint)

@hadley hadley added download ⬇️ feature a feature request or enhancement labels May 1, 2020
@hadley
Copy link
Member

hadley commented May 1, 2020

Fixed by #372

@hadley hadley closed this as completed May 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
download ⬇️ feature a feature request or enhancement
Projects
None yet
Development

No branches or pull requests

3 participants