This script would export data from Piwik Database to BigQuery so that it could be able to handle such a large of data and do customized report.
It would be a part in near future that Piwik should use BigQuery for data processing instead of mysql. Archive Processing would be much faster and cheaper with BigQuery