Saturday, September 1, 2012

How to create datasets and BigTables into Google BigQuery?

This article is in continuation to the last article What is Google BigQuery.

Once your access to Google BigQuery is enabled and your billing details are setup, you are all set to store data into Google cloud. The data stored in these BigTables can be accessed using three tools that Google has provided.

  1. BigQuery Browser Tools
  2. Bq Command-line tool
  3. REST API

In this post we will examine BigQuery Browser Tool. To start with Browser Tool you need to navigate to Google BigQuery webpage https://bigquery.cloud.google.com/.

When you login into Google BigQuery, the default screen you see is following. Your projects are listed on the left side of panel. Google provides a sample dataset and few sample BigTables.

The first step towards creating BigTables is creating a Dataset. Dataset are containers for BigTables. To create Dataset you can click on your project and select Create new dataset. You will find the Create Dataset screen where you have to provide your Dataset a name.

For demonstration purpose, I created a dataset with the name Employee_DS_BQ.

Once I clicked on OK, data set Employee_DS_BQ got created and it got listed on the left side of panel.

Now we have created the dataset, it is time now to create BigTables. To create BigTables we need to click on the + sign next to dataset. This will launch the Create Tables screen.

In the Create Table screen, you have to enter your table name into Table ID field. In Schema field you need to specify your columns names. The columns are specified in the format [column name:datatype]. Google BigQuery currently supports following data types for columns:

- String
- Integer
- Boolean
- Float

You can click on OK button if you want or you can proceed to load data from Create Table screen. For demonstration purpose, I created one table EmpDetails and specified three columns empName, empAge and empActive.

The next thing I am doing is loading data into these tables. I have following data in a CSV file that I need to upload to the BigTable EmpDetails.

I clicked on Choose File button on Create Table screen and selected my CSV file. I clicked on Ok button.

A job was created by the Google BigQuery service and my BigTable was successfully created with the sample data.

So this is how we can create BigTable and load data inside it using Google BigQuery.

In next article we will learn to Query this data

Popular Posts

Real Time Web Analytics