Loading Multiple CSV files into BigQuery Using Python

Juan Raful
4 min readAug 18, 2023
Icon of a database silo linked to three folder icons
Icon made by Smashicons from www.flaticon.com

BigQuery is a serverless and fully managed data warehouse and analytics platform that lets users analyze vast amounts of data using SQL syntax quickly and reliably. Computing resources are dynamically allocated, increasing and decreasing as necessary, and the execution engine optimizes a distributed architecture for fast execution.
From a Business/Data Analyst perspective, it is a great tool as it will allow you to use familiar SQL syntax over structured data. However, you might have to get the data in there first. There are multiple ways to load data into BigQuery; the GUI allows you to create a table and populate it with a file in a few clicks, although uploading multiple files will be time-consuming. The BigQuery console can do the same by processing commands, although it can also get lengthy if the number of files is representative and it is more difficult to troubleshoot.

Task description

Upload the data from multiple CSV files into BigQuery, making a table for each CSV file, and make sure they have a reasonable name and schema.

Step 1: load files to a Google Cloud bucket

Not mandatory. A similar process can also be executed using files from Google Drive or a local repository. However, I decided to load the…

--

--

Juan Raful

Data Analyst posting on all things data for business. Humble ideas to solve business problems.