[MUSIC PLAYING]
SPEAKER 1: If you are looking to run queries on data
not already part of public or shared data sets,
you must first load your data into BigQuery.
BigQuery accepts data in several formats.
This video will cover how to load data from a CSV
file on your local machine into BigQuery, using the web UI.
This process requires a Google Cloud Platform
project with billing enabled.
Within your project, you may take advantage of the Google
Cloud free tier and bypass cost by staying
within the tier limits for Cloud Storage and BigQuery.
Loading data into BigQuery via the web
UI can be done two ways, first by loading the data directly
from your local machine, or second by using Google Cloud
Storage as an intermediary.
Direct uploads from your computer using the BigQuery web
UI are limited to 10 megabytes.
For this reason, this video will focus
on loading data into BigQuery by way of Google Cloud Storage,
which doesn't have this limit.
Get started in the BigQuery web UI.
Identify the data set to which you would
like to add the new table.
If using an existing data set, note the data location.
The data location will be needed in a future step.
If you need to create a new data set, do so now.
To create a new data set, select the project name
in the left-hand nav, and then click the Create Data Set
button.
Name the data set, choose the data set location,
and then click Create Data Set.
The new data set will shortly appear in the left-hand nav.
Next, navigate to cloud storage, by typing "storage"
into the search bar in the console.
When you arrive, click the Create Bucket button.
Name your bucket, then choose the location.
You must choose a location for your cloud storage bucket
in the same region as the location of the BigQuery data
set.
The bucket can be either a multi-regional bucket,
or a regional bucket in the same region as the data set.
One exception, you can load data in a US-based data
set from any region.
Since you are creating this bucket for the sole reason
to transfer the data into BigQuery,
save on egress charges by choosing
the exact same location as your destination
data set in BigQuery.
In this demo, that is Multi-region US.
Choose the Standard Storage Class, then click Create.
Now, you may click the Upload Files button
to select the file you want to upload,
or simply drag the file from your desktop
onto the Google Cloud Storage browser.
Once the upload finishes, navigate back
to the BigQuery web UI.
Select your data set, and click Create Table.
Choose Google Cloud Storage as your source.
Click browse, double-click on the storage bucket,
and select your data object.
The file format should update automatically.
Provide a table name.
You can either provide the schema details,
or click the box to Auto Detect the Schema.
At this time, you may choose to partition and cluster
your data.
A video outlining the hows and whys
of partitioning and clustering is linked
in the video description below.
If your CSV file has a header row,
display the Advanced Options and add the number of head arrows
in the Header Rows to Skip field.
There are also several other options you can choose,
including Alternative Field Delimiters Based on your File.
Now click Create Table.
A load job will be created.
When the job finishes, you can view the table schema, details,
and a preview of the data.
Now your table is ready to be queried.
Click Query Table, and a preloaded query statement
will appear in the Query Editor, which
you can begin editing directly.
Before diving into the data, consider
if you would like to delete the file you originally loaded
into Google Cloud Storage.
Depending on your situation, it can also
be useful to keep it as a backup.
Both Cloud Storage and BigQuery storage have separate pricing,
so be sure to review the pricing documentation linked below.
Thanks for watching, and happy analyzing.
[MUSIC PLAYING]