Skip to Content
Learning Google BigQuery
book

Learning Google BigQuery

by Thirukkumaran Haridass, Eric Brown
December 2017
Beginner to intermediate
264 pages
5h 38m
English
Packt Publishing
Content preview from Learning Google BigQuery

Creating the table definition

Download the sample file from this URL and upload it to a Google Cloud Storage bucket: https://github.com/hthirukkumaran/Learning-Google-BigQuery/blob/master/chapter1/employeedetails.csv.

To create a table definition file, run the following command. Replace the bucket name and filename as per your project. The following command detects the schema of the table from the file:

bq mkdef --autodetect --source_format=CSV "gs://myfirstprojectbucket201706/employeedetails.csv" >  tabledefinition.txt

The preceding command outputs a JSON format file. The file will look like the one shown in the following screenshot. Once this file is generated, we can use it to query the data in the CSV file defined in this file.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Google BigQuery: The Definitive Guide

Google BigQuery: The Definitive Guide

Valliappa Lakshmanan, Jordan Tigani
Google BigQuery Analytics

Google BigQuery Analytics

Siddartha Naidu, Jordan Tigani

Publisher Resources

ISBN: 9781787288591Supplemental Content