Loading data into a table using BigQuery

Using pre-created or custom datasets is also a very common practice in data analytics. Thus, to load data into a table:

  1. Download or locate the data you intend to load. For example, we are using the babynames ZIP file, which is an open dataset. Download it using this URL: http://www.ssa.gov/OACT/babynames/names.zip.
  2. Extract the file at your desired location and you will notice a yob2014.txt file, which is a CSV file.
  3. Go to the console of BigQuery and locate a downward arrow near your project name. Then, click on the Create new dataset button:
  1. Give the dataset an ID of babynames:
  1. Keep all of the other settings as default. Click the OK button

 

  1. Find the drop-down icon near dataset ID and click on the Create new table option:
  1. To upload the datafile, click on the Choose file button and enter the path of your datafile, which is yob2014.txt in our case:
  1. Enter any name as destination table. We are keeping names_2014:
  1. Now, let's edit the schema of the database. Click on the Edit as Text option, which can be found in the bottom-right corner of the database and input the following string as text:
Name:string,gender:string,count:integer 
  1. Finally, click on the Create table button and check out the preview. Now this table is ready to be queried:
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
52.15.163.239