Posted on

Getting Started with dbt Cloud, dbt Studio and Google BigQuery

Updated: 20260121

The purpose of this tutorial is to introduce data engineers to the basic functionality of dbt Cloud services by connecting dbt Studio to Google BigQuery to hos the data warehouse and GitHub for source code management.

Prerequisites

Before starting this tutorial, the following accounts and systems should be set up.

1. A data warehouse database should be created and/or configured. This tutorial uses Google BigQuery. In Google BigQuery, create a dataset that will hold the project data. Upload source data or create tables in BigQuery that will hold the data to be transformed.

For Google BigQuery, follow this tutorial to create a Service Account and download the Service Account JSON file (containing the private key). Make sure this file is available when configuring the connection to BigQuery.

To obtain the 311 complaint data that matches your complaint types, do one of the following:

  1. You can use the Socrata API to fetch this data from NYC Opendata and save it to a CSV file (or a series of files). Then load this CSV file into a BigQuery table.
  2. Create a table in BigQuery by pulling the data from a bigquery-public-data dataset.

  # Create a subset of the 311 data in BigQuery
  CREATE OR REPLACE TABLE `NYC_311_Complaints.bicycle_complaints_2014`
  AS
  SELECT * FROM 
  `bigquery-public-data.new_york_311.311_service_requests`
  WHERE complaint_type LIKE  '%Bicycle%' 
     AND FORMAT_DATE("%Y", created_date)=2014

Note: Replace the section WHERE complaint_type LIKE '%Bicycle%' with the specific complaint type (or types) you are going to be working with.

2. dbt can use GitHub as a source code Repository. Set up a GitHub account and be ready to create a repository to hold the source code for dbt transformations.

The next page will introduce setting up a dbt account.

Posted on

Reverse Engineering a Google BigQuery schema with DbSchema 10

Updated: 20260112

Introduction

The purpose of this tutorial is to demonstrate how to reverse engineer a Google BigQuery dataset into a physical level diagram using the DbSchema version 10 software. Reverse Engineering is the process of reconstructing a physical and/or ER model from an existing schema. Reverse Engineering can be used to provide documentation on an existing application, provide applications developers with a better overall picture of the schema and provide better guidance when performing changes to the schema.

DbSchema is a powerful software tool that is able to connect to an extensive number of different database management systems including cloud-based databases like AWS Redshift and Google BigQuery. The DbSchema software is supported on MS Windows, Mac OSX and Linux.

Tutorial Pre-Requisites

Before starting this tutorial, download and install the DbSchema software for your operating system. Note that this tutorial will use the Free Community Edition.

You should also have a Google Cloud Platform (GCP) Project set up and associated with a billing account. Be sure to note your Project id and GMail account associated with the GCP account. The BigQuery dataset to be reverse engineered should be located under your GCP Project. If you currently do not have any data sets, consider copying one of the free open source data sets into your own BigQuery project. For example, this tutorial makes use of the CMS Synthetic Patient Data OMOP Data set that has the name: cms_synthetic_patient_data_omop. This data set is available through BigQuery Public datasets. Use the BigQuery console to copy this data set into your own Project.

Connecting to Google BigQuery from DbSchema requires a Service Account and Key File. This tutorial [link] provides instructions on how to create a Service Account and Key File. If you have not created your Service Account and Key File, please do that before you move on with the rest of this tutorial. Make sure you store your Key File in a secure location. This tutorial assumes you have the Key File stored in your Documents folder. In Windows this would be the c:\users\username\Documents folder (where “username” is your Windows user name). In MacOSX, this will be the /Users/username/Documents folder. In Linux this will be the /home/username/Documents folder.

After creating your Service Account Key file, use the Identity and Access Management (IAM) page to grant the BigQuery Admin Role to your service account. In Google Cloud Platform, navigate to IAM&Admin > IAM, click on the pencil icon to edit the Principal for your service account. Click the + Add another role button and select BigQuery Admin. Then click Save.

With these pre-requisites in place, the reverse engineering process can be started by connecting to a BigQuery dataset. These steps are described on the next page.

Posted on

Managing Quotas in Google Cloud Platform

Introduction

Google Cloud Platform (GCP) offers a wide range of services to support virtual networks, virtual machines, databases, data storage, messaging, clusters and many other services in the cloud. While running, each GCP service allocates and consumes some resources such as disk space, memory (RAM), CPUs and networks. In general, a billing account on GCP cannot allocate and consume unlimited resources. Instead, each resource is typically limited by a Quota.

Before a new service is launched, GCP will check the resources required for the service against the quota available. If enough quota is available, the service will be launched. If insufficient quota is available, the service may be canceled or may not launch properly.

There are over 20,000 individual quota settings in GCP. This large number of quotas is largely due to the fact that there are individual quotas for each type of resource in each region of the world. For example, one CPU type is “A2 CPUs” and there is a quota associated with using this type of CPU in each of the 40 regions. With so many quotas to monitor, it is important to learn how to filter the list of quotas – a topic this tutorial covers.

The purpose of this tutorial is to demonstrate how to manage Quotas in GCP and how to request an increase in quota limits.

Steps to view and filter the list of quotas are shown on the next page.

Posted on

Creating a Linux Virtual Machine using Google Cloud Platform

August, 2024

Introduction

This tutorial demonstrates how to create a Linux virtual machine using the Google Cloud Platform.

This tutorial assumes you already have a Google Cloud account set up. If you do not have a Google Cloud Platform account set up, please follow these instructions first.

The Google Cloud Platform consists of different services including Compute services such as the App Engine, Container Engine and Compute Engine, and Storage services such as Google Cloud Storage and BigTable.

For this tutorial we will use the Compute Engine service to create a Linux Virtual Machine (VM). A virtual machine is a digital version of a physical computer. [Read more about Virtual machines here]. Virtual machines can be started and stopped on demand. While running, Secure Shell can be used to log in to the server and carry out different maintenance and software installation tasks.

Pre-Requisites

Prior to starting this tutorial, a Google Cloud Account should be created. Visit the Google Cloud Console web page to get started.

Tutorial Outline

In this tutorial you will learn how to:

  1. Log in to the Google Cloud Console and enable the Compute Engine API
  2. Create a new Compute Engine Instance
  3. Connect to the Linux Virtual Machine instance using Secure Shell
  4. Monitor Linux System Resources
  5. Shut down the Linux Virtual Machine instance
  6. Change the size of the boot disk (hard drive) for a VM Instance
  7. Change the Machine Type for a VM Instance
  8. Delete a Virtual Machine instance
  9. Use the gcloud command line to create a Linux VM instance

Each of these steps is described on the pages that follow.

Posted on

Downloading Kaggle Data Sets using the Linux Command Line

The following tutorial covers how to download datasets from Kaggle using the Linux command line tools in a virtual machine running on Google Cloud Platform.

This tutorial breaks this task down into multiple steps including:

In Kaggle: Download API Token file and then locate a data set

In Google Cloud:

  • Create a Compute Engine VM
  • Upload API Token file
  • Set up Python environment
  • Download Kaggle Data set
  • Unzip Kaggle Data set
  • Copy files to Google Cloud Storage

If you would prefer a video presentation of these materials, please use this link to YouTube

Prerequisites

Before starting this tutorial, make sure you create an account on Kaggle.com and then log in to your Kaggle.com account.

Log in to your Google Cloud Platform account and make sure you have enabled the Compute Engine API

Tutorial Sections

Get started on the tutorial by downloading the Kaggle API Token file as described on the next page.

Posted on

Running Jupyter Notebook on Google Cloud Platform Dataproc

January 16, 2024

The purpose of this tutorial is to demonstrate setting up Jupyter Notebook to run on the Google Cloud Platform service called Dataproc.

Google Cloud Dataproc is Google’s implementation of the Hadoop ecosystem that includes the Hadoop Distributed File System (HDFS), Map/Reduce and Spark processing framework. The Google Cloud Dataproc system includes several applications such as Hive, Mahout, Pig, Spark and Hue that are built on top of Hadoop.

Apache Spark is a processing framework that operates on top of the Hadoop Distributed File System (HDFS) (as well as other data stores). It features interactive shells that can launch distributed process jobs across a cluster. Spark supports programming language interfaces for Scala, Java, Python and SQL. PySpark is the Python interface to Spark.

Prerequisites

Before starting this tutorial, the following tutorials and notes should be reviewed.

This tutorial assumes you have a basic understanding of Hadoop and Spark as well as some programming experience with Python and PySpark.

This tutorial also assumes you already have a Google Cloud Platform account set up and funded. If you do not have a Google Cloud Platform account set up, please follow these instructions first. Within GCP you will have at least one “Project” with a Project Name and Project ID. In this tutorial, the example project name is “My First Project” and the Project ID is: ‘handy-bonbon-142723’. Make a note of your Project Name and Project ID and use your own in place of what you see in the examples in this tutorial.

Google Cloud Platform operates using a series of Application Programming Interfaces (APIs). Most GCP services has an associated API that must be enabled before you can use the service. For the Dataproc service, make sure you have the following APIs enabled:

  • Cloud Dataproc API
  • Compute Engine API
  • Cloud Resource Manager API

You can enable APIs by visiting the APIs & Services console page.

These instructions were created in January 2024. Some configuration pages may have changed since then.

Topics Outline

Running Jupyter Notebook on Google Cloud Dataproc requires the following main steps:

  • Enable the Google Cloud Compute Engine API and Cloud Dataproc API
  • Create, Configure and Launch a Google Cloud Dataproc cluster
  • Create, Upload, Download and work with Jupyter Notebooks
  • Shut down cluster and remove any temporary resources
  • Creating a Dataproc cluster with Google Cloud Shell

Each of these topics will be covered in the sections that follow.

Posted on

Running Jupyter Notebook on Amazon EC2

Introduction

This tutorial is current as of October, 2023.

Amazon Elastic Cloud Compute (EC2) is a service for hosting virtual machines in the Amazon web services cloud. An EC2 instance can be created with a variety of hardware configurations (CPU, disk, memory) and operating systems.

Jupyter Notebooks are a popular way to write software for Python and PySpark. A notebook can be hosted in a web browser and can provide code and documentation cells for individual parts of the software.

This tutorial covers how to install and configure Jupyter Notebook so that it will run on an EC2 instance with Amazon Linux.

This tutorial assumes you have an Amazon Web Services Account and that you can log in and view the AWS Management Console.

 

The first step will be to create an EC2 instance (if you do not have one currently) and the instructions will follow on the next page.

Posted on

Running an Amazon EMR Cluster in the AWS Academy Data Engineering Sandbox

Introduction

This is a brief tutorial about how to run an Amazon Elastic Map Reduce (EMR) cluster in the AWS Academy Sandbox environment.

Before you begin, make sure you are completely logged out of your personal AWS Management Console. Or, use a different web browser to log in to AWS Academy.

Make sure you have accepted your professor’s invitation to join the Data Engineering course on AWS Academy.

Please note that it can take between 5 to 10 minutes to start up the Sandbox and then 15 to 20 minutes to start up an EMR cluster.

Posted on

Reverse Engineering a Google BigQuery Schema with Dataedo 10

Introduction

The purpose of this tutorial is to demonstrate how to reverse engineer a Google BigQuery dataset into a physical level diagram using the Dataedo version 10 software. Reverse Engineering is the process of reconstructing a physical and/or ER model (diagram) from an existing database schema. Reverse Engineering can be used to provide documentation on an existing application, provide applications developers with a better overall picture of the schema and provide better guidance when performing changes to the schema.

Dataedo is a powerful software tool that is able to connect to an extensive number of different database management systems including cloud-based databases like AWS Redshift and Google BigQuery. Currently, Dataedo only runs on Microsoft Windows operating system.

Tutorial Pre-Requisites

This tutorial uses Google BigQuery as the source database management system. You should also have a Google Cloud Platform (GCP) Project set up and associated with a billing account. Be sure to note your Project id and GMail account associated with the GCP account. After setting up your account, enable the Cloud Resource Manager API using the APIs and Services menu in the GCP Console.

The BigQuery dataset to be reverse engineered should be located under your GCP Project. If you currently do not have any data sets, consider copying one of the free open source data sets into your own BigQuery project. For example, this tutorial makes use of the CMS Synthetic Patient Data OMOP Data set [Link] that has the name: cms_synthetic_patient_data_omop available through BigQuery Public datasets. Use the BigQuery console to copy this data set into your own Project.

Connecting to Google BigQuery from Dataedo requires a Service Account and Key File. This tutorial [link] provides instructions on how to create a Service Account and Key File. If you have not created your Service Account and Key File, please do that before you move on with the rest of this tutorial. Make sure you store your Key File in a secure location. This tutorial assumes you have the Key File stored in your Downloads folder. In Windows this would be the c:\users\username\Documents folder (where “username” is your Windows user name). Use Windows File Explorer to view the Documents folder and confirm your Key File has been downloaded.

Before starting this tutorial, download and install the Dataedo software. Currently (January 2023), Dataedo offers a free 14 day trial license. Sign up for the free trial and go through the e-mail verification and sign up. During the sing-up process select the operating system (Mac, Windows or Linux) that you are using. Then the Download page should appear as shown below. Only the Dataedo Desktop is required.

After downloading the file (such as Dataedo_Desktop_10.4.0_setup.exe) to your downloads folder, double-click on the file to launch the installer. Follow all of the default steps to install Dataedo.

The first step in working with Dataedo is to establish a repository for database metadata. The steps to create a simple single user repository in Dataedo are provided on the next page.

Posted on

Reverse Engineering a Google BigQuery Schema with DbSchema 9

NOTE: This tutorial is for an older version of dbschema. You may wish to view the updated tutorial: Reverse Engineering a Google BigQuery Schema with DbSchema 10.

Introduction

The purpose of this tutorial is to demonstrate how to reverse engineer a Google BigQuery dataset into a physical level diagram using the DbSchema software. Reverse Engineering is the process of reconstructing a physical and/or ER model from an existing schema. Reverse Engineering can be used to provide documentation on an existing application, provide applications developers with a better overall picture of the schema and provide better guidance when performing changes to the schema.

DbSchema is a powerful software tool that is able to connect to an extensive number of different database management systems including cloud-based databases like AWS Redshift and Google BigQuery. The DbSchema software is supported on MS Windows, Mac OSX and Linux. DbSchema offers a free license version that has limited features.

Tutorial Pre-Requisites

Before starting this tutorial, download and install the DbSchema software for your operating system.

You should also have a Google Cloud Platform (GCP) Project set up and associated with a billing account. Be sure to note your Project id and GMail account associated with the GCP account. The BigQuery dataset to be reverse engineered should be located under your GCP Project. If you currently do not have any data sets, consider copying one of the free open source data sets into your own BigQuery project. For example, this tutorial makes use of the CMS Synthetic Patient Data OMOP Data set that has the name: cms_synthetic_patient_data_omop. This data set is available through BigQuery Public datasets. Use the BigQuery console to copy this data set into your own Project.

Connecting to Google BigQuery from DbSchema requires a Service Account and Key File. This tutorial [link] provides instructions on how to create a Service Account and Key File. If you have not created your Service Account and Key File, please do that before you move on with the rest of this tutorial. Make sure you store your Key File in a secure location. This tutorial assumes you have the Key File stored in your Documents folder. In Windows this would be the c:\users\username\Documents folder (where “username” is your Windows user name). In MacOSX, this will be the /Users/username/Documents folder. In Linux this will be the /home/username/Documents folder.

After creating your Service Account Key file, use the Identity and Access Management (IAM) page to grant the BigQuery Admin Role to your service account. In Google Cloud Platform, navigate to IAM&Admin > IAM, click on the pencil icon to edit the Principal for your service account. Click the + Add another role button and select BigQuery Admin. Then click Save.

With these pre-requisites in place, the reverse engineering process can be started by connecting to a BigQuery dataset. These steps are described on the next page.