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

Problem setting up local MySQL database to store airlines data #57

Open
trant22t opened this issue Dec 3, 2016 · 3 comments
Open

Problem setting up local MySQL database to store airlines data #57

trant22t opened this issue Dec 3, 2016 · 3 comments

Comments

@trant22t
Copy link

trant22t commented Dec 3, 2016

I tried to set up a local MySQL database to store the airlines data. When I ran:

library(etl)
library(airlines)
db <- src_mysql_cnf(dbname = "airlines")
ontime <- etl("airlines", db = db, dir = "~/dumps/airlines")
ontime %>%
  etl_init() %>%
  etl_update(years = 2016)

R gave me the error message:
Error in download.file(url, method = method, ...) :
cannot download all files
In addition: Warning message:
In download.file(url, method = method, ...) :
URL 'http://tsdata.bts.gov/PREZIP/On_Time_On_Time_Performance_2016_10.zip': status was '404 Not Found'

I'm on a Mac and my R version is 3.3.1.

@nicholasjhorton
Copy link
Collaborator

I hope that there are ways to make the data loading a bit more robust. I worry that this command would download 30 years of data then bomb out because of the missing months in 2016.

I also wonder if the instructions might be modified to start with a less aggressive data load:

ontime %>%
etl_init() %>%
etl_update(years = 1987:2016)

Perhaps showing how to install a single (complete year, e.g., 2015) then add in the other years?

ontime %>%
etl_init() %>%
etl_update(years = 2015)

takes a long time!

ontime %>%
etl_update(years= c(1987:2014, 2016))

Additional note from NJH: the example now has more than 24GB!

There are over 300 months worth of files to download, and they will occupy more than 21 GB in their zipped and unzipped states.

@beanumber
Copy link
Owner

This is a known bug (#54). The problem is that we don't know which months of data are available on the server until we try to download them. I'm happy to field a pull request if you have a way for this function to fail gracefully.

Note that while the error breaks etl_extract(), it occurs after you have downloaded all of the valid data. So you can proceed by running etl_transform() and etl_load() in succession and these should still work.

@nicholasjhorton
Copy link
Collaborator

nicholasjhorton commented Dec 3, 2016 via email

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

No branches or pull requests

3 participants