Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
Learning Google BigQuery
Learning Google BigQuery

Learning Google BigQuery: A beginner's guide to mining massive datasets through interactive analysis

Arrow left icon
Profile Icon Berlyant Profile Icon Haridass Profile Icon Brown
Arrow right icon
€8.99 €23.99
Full star icon Full star icon Full star icon Half star icon Empty star icon 3.3 (4 Ratings)
eBook Dec 2017 264 pages 1st Edition
eBook
€8.99 €23.99
Paperback
€29.99
Subscription
Free Trial
Renews at €18.99p/m
Arrow left icon
Profile Icon Berlyant Profile Icon Haridass Profile Icon Brown
Arrow right icon
€8.99 €23.99
Full star icon Full star icon Full star icon Half star icon Empty star icon 3.3 (4 Ratings)
eBook Dec 2017 264 pages 1st Edition
eBook
€8.99 €23.99
Paperback
€29.99
Subscription
Free Trial
Renews at €18.99p/m
eBook
€8.99 €23.99
Paperback
€29.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Learning Google BigQuery

Google Cloud SDK

Google Cloud Platform provides an SDK developed in Python to manage the resources in the Cloud. The framework is available for Windows, Linux, and macOS. Python 2.7 is a requisite for installing this SDK. The SDK provides command-line utilities to manage and interact with various services on Google Cloud.

The following are the three command-line utilities available in SDK:

  • gsutil: This is the command-line utility to interact with Google Cloud Storage
  • bq: This is the command-line utility to interact with Google BigQuery
  • gcloud: This is the command-line utility to interact with all other services on Google Cloud

Installing Google Cloud SDK

The installers are available for Windows, Linux, and macOS. Since Linux has various distributions, some manual command execution is needed for installing and configuring the Google Cloud SDK on Linux.

Installing Google Cloud SDK on Windows

Google Cloud SDK for Windows comes with a friendly installer and it also comes with an option to install Python which is a prerequisite to run the commands in Google Cloud SDK:

  1. Download the installer from the link provided: https://cloud.google.com/sdk/docs/quickstart-windows. The installer is a GUI-based utility which will install the requisites for the SDK, and the SDK with default configuration.
  1. In the installation wizard, choose the Bundled Python...

gsutil for Google Cloud Storage

gsutil provides options to manage files, folders, and buckets in Google Cloud Storage. The first step in moving your data to Google Cloud and Google BigQuery is to export the data and upload to Google Cloud Storage:

  • Manually via the browser if it is small
  • Automate it for basic scenarios using gsutil, which comes with Google Cloud SDK
  • The third option will be to use the Google Cloud Storage API to perform advanced automation

Before using the gsutil command, make sure that the project and credentials configured in the Google Cloud SDK are pointing to the project and account which you intend to use by typing the following command:

gcloud info

We will now look at the features available with gsutil:

  • To see the list of options provided by gsutil, type the following command:
gsutil help
  • The available commands section shows the command...

Using the bq utility for BigQuery

The bq command-line utility is used to interact with the Google BigQuery service on Google Cloud Platform:

  • Use the following command to check the version of the bq utility once the SDK is installed:
bq version
  • Type the following command to confirm which project the bq utility will use. The bq utility shares settings with the gcloud utility. If you wish to change the project, then run the command in the second line and choose the project you want to work on:
gcloud info
gcloud init
If an older version of Google Cloud SDK is installed on the machine, then run the bq init command to choose the default project for the bq utility to use. Use the bq help option to see the complete details of the command, its options, and its switches.
  • The first step in using BigQuery is to create a dataset in a project and then create tables...

Using the gcloud utility

The gcloud utility is used to interact with the rest of the services on the Google Cloud Platform, other than BigQuery and Google Cloud Storage. The commands in the gcloud utility are grouped for each service. The following are the service groups for some of the services on the Google Cloud Platform:

Service group

Google Cloud service

App

App Engine standard and flexible environment

Compute

Compute Engine to manage virtual machines

Container

Container Engine to manage containers and clusters

Dataflow

Manage Cloud Dataflow services for ETL and data processing

Dataproc

Manage Cloud Dataproc service which consists of Apache Hadoop, Spark, Pig, and Hive

Datastore

Manage Cloud Datastore service which creates entities on a NoSQL database

SQL

Manage Cloud SQL service which consists of MySQL or PostgreSQL databases...

Connecting to Cloud SQL using gcloud

There is more than one way to connect to a Cloud SQL instance from your machine, but the two most frequently used options are in the following list. The listed prerequisites for both the options require the MySQL client libraries to be installed on the local machine:

  • Adding the client machine IP address to authorized networks in Google Cloud Console
  • Installing a proxy script on the client machine and using that to connect to Google Cloud SQL

Authorizing the client machine via Google Cloud Console

Get the IP address of the client machine by opening the browser and navigating to this URL: http://ipv4.whatismyv6.com/. Note down the IP address shown on this page for your machine. Open Google...

Deploying to Google App Engine

To deploy to Google App Engine, use the app command group. The App Engine allows us to host websites developed in PHP, Java, Go, or Python in the standard environment. To deploy a sample app to the App Engine instance that was created in Chapter 1, Google Cloud and Google BigQuery, follow the steps listed here:

  1. Download the sample PHP file and app.yaml file from the GitHub URL (https://github.com/hthirukkumaran/Learning-Google-BigQuery/tree/master/chapter2/phpapp) to a folder on the local computer. This PHP code connects to the Cloud SQL instance of the same project, executes a sample query, and displays the result.
  2. Open the index.php file and modify the $dsn variable value to point to your Cloud SQL instance. To get the full qualified Cloud SQL instance name, open the Cloud SQL instance in your project. Copy the value of the instance connection...

Summary

This chapter covered the Google Cloud SDK and the utilities that come with it. The samples in this chapter provided an overview of how to interact with Google Cloud Services and how to manage your resources on Google Cloud Platform using the Google Cloud SDK. Use the utilities to write your batch programs that you run from your on-premises infrastructure.

The next chapter covers data types in Google BigQuery, how to use them when creating custom tables, and how to import and export the data using the bq utility that was covered in this chapter.

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Get started with BigQuery API and write custom applications using it
  • Learn how BigQuery API can be used for storing, managing, and query massive datasets with ease
  • A practical guide with examples and use-cases to teach you everything you need to know about Google BigQuery

Description

Google BigQuery is a popular cloud data warehouse for large-scale data analytics. This book will serve as a comprehensive guide to mastering BigQuery, and how you can utilize it to quickly and efficiently get useful insights from your Big Data. You will begin with getting a quick overview of the Google Cloud Platform and the various services it supports. Then, you will be introduced to the Google BigQuery API and how it fits within in the framework of GCP. The book covers useful techniques to migrate your existing data from your enterprise to Google BigQuery, as well as readying and optimizing it for analysis. You will perform basic as well as advanced data querying using BigQuery, and connect the results to various third party tools for reporting and visualization purposes such as R and Tableau. If you're looking to implement real-time reporting of your streaming data running in your enterprise, this book will also help you. This book also provides tips, best practices and mistakes to avoid while working with Google BigQuery and services that interact with it. By the time you're done with it, you will have set a solid foundation in working with BigQuery to solve even the trickiest of data problems.

Who is this book for?

If you are a developer, data analyst, or a data scientist looking to run complex queries over thousands of records in seconds, this book will help you. No prior experience of working with BigQuery is assumed.

What you will learn

  • Get a hands-on introduction to Google Cloud Platform and its services
  • Understand the different data types supported by Google BigQuery
  • Migrate your enterprise data to BigQuery and query it using the legacy and standard SQL techniques
  • Use partition tables in your project and query external data sources and wild card tables
  • Create tables and data sets dynamically using the BigQuery API
  • Perform real-time inserting of records for analytics using Python and C#
  • Visualize your BigQuery data by connecting it to third party tools such as Tableau and R
  • Master the Google Cloud Pub/Sub for implementing real-time reporting and analytics of your Big Data

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Dec 22, 2017
Length: 264 pages
Edition : 1st
Language : English
ISBN-13 : 9781787286290
Category :
Languages :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Dec 22, 2017
Length: 264 pages
Edition : 1st
Language : English
ISBN-13 : 9781787286290
Category :
Languages :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 96.97
Google Cloud Platform for Developers
€36.99
Learning Elastic Stack 6.0
€29.99
Learning Google BigQuery
€29.99
Total 96.97 Stars icon
Banner background image

Table of Contents

8 Chapters
Google Cloud and Google BigQuery Chevron down icon Chevron up icon
Google Cloud SDK Chevron down icon Chevron up icon
Google BigQuery Data Types Chevron down icon Chevron up icon
BigQuery SQL Basic Chevron down icon Chevron up icon
BigQuery SQL Advanced Chevron down icon Chevron up icon
Google BigQuery API Chevron down icon Chevron up icon
Visualizing BigQuery Data Chevron down icon Chevron up icon
Google Cloud Pub/Sub Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Half star icon Empty star icon 3.3
(4 Ratings)
5 star 25%
4 star 25%
3 star 0%
2 star 50%
1 star 0%
Robert Robinson Jan 26, 2018
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This book is easy to understand to know what is Big query and how to use Google BigQuery, Google services with good examples.This book covers in beginning how to start with Google cloud services and their types of services. It helped me to do project in Google App Engine and Google BigQuery. We can learn BigQuery API with examples and the current capabilities of the platform.The great thing in this book is we can choose the language in C#.Net or Python to get into Google BigQuery API.Finally it's a great book for BigQuery beginners.
Amazon Verified review Amazon
FSTB Jan 29, 2018
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
This is a step by a step book that give you the bases and the power through all the reading. As you read and follow the exercises, you quickly learn and understand the meaning behind BigQuery. Easy to read, easy to learn. The author gives tips and lessons based on their experience. Using this data warehouse solution, you will save time and get into work very quickly. You will see results as you follow the guides from this book.
Amazon Verified review Amazon
Eike Pierstorff Jun 07, 2018
Full star icon Full star icon Empty star icon Empty star icon Empty star icon 2
This is not a "guide to mining massive datasets", this is a guide to run very basic SQL queries against a high performance cloud database; basic SQL does not suddenly become "data mining" because you run it on a cloud database, or via an API. If you really need to have explained to you what "SELECT" does in a SQL statement then BigQuery might not be a good tool for you in the first place (and don't event get me started on the so called "Advanced SQL" section).What's left is an okay-ish step by step manual on how to create a BigQuery project and set up API access, so if you prefer spending some 20 bucks over searching for ten minutes to find the appropriate support pages this book might be for you.This book might make sense if you take the "beginner" in the title to mean "first time database users" (which would be akin to "heart surgery for first time knife users"). I mistook "beginner" to mean "BigQuery beginner" (i.e. I thought I could expand existing SQL skills into data mining), but even so, for SQL starters there is just no point to start with BigQuery. Basically any SQL manual will be more useful.
Amazon Verified review Amazon
George A. Quintas Jan 25, 2018
Full star icon Full star icon Empty star icon Empty star icon Empty star icon 2
The kindle version is not working on Kindle Cloud Reader. I only able to read from location 1 to location 719 and beyond that the contents are all unreadable and I lost interest reading this book and did not bother to read the rest of the pages (location 1429 on wards are readable). I need a refund please or send me a complete working copy. So far the readable locations gave me the information that I need but still I need a complete book.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.