Instructions et exigences de configuration de l'atelier
Protégez votre compte et votre progression. Utilisez toujours une fenêtre de navigation privée et les identifiants de l'atelier pour exécuter cet atelier.

Create and execute a SQL workflow in Dataform

Atelier 1 heure universal_currency_alt 1 crédit show_chart Débutant
info Cet atelier peut intégrer des outils d'IA pour vous accompagner dans votre apprentissage.
Ce contenu n'est pas encore optimisé pour les appareils mobiles.
Pour une expérience optimale, veuillez accéder à notre site sur un ordinateur de bureau en utilisant un lien envoyé par e-mail.

Overview

This lab walks you through the process to create and execute a SQL workflow in Dataform to load data in BigQuery.

Learning objectives

  1. Create a Dataform repository.
  2. Create and initialize a Dataform development workspace.
  3. Create and execute a SQL workflow.
  4. View execution logs in Dataform.

Setup

For each lab, you get a new Google Cloud project and set of resources for a fixed time at no cost.

  1. Sign in to Google Skills using an incognito window.

  2. Note the lab's access time (for example, 1:15:00), and make sure you can finish within that time.
    There is no pause feature. You can restart if needed, but you have to start at the beginning.

  3. When ready, click Start lab.

  4. Note your lab credentials (Username and Password). You will use them to sign in to the Google Cloud Console.

  5. Click Open Google Console.

  6. Click Use another account and copy/paste credentials for this lab into the prompts.
    If you use other credentials, you'll receive errors or incur charges.

  7. Accept the terms and skip the recovery resource page.

Task 1. Create a Dataform repository

  1. In the Console, expand the Navigation menu, then select BigQuery > Dataform.

  2. Click CREATE REPOSITORY.

  3. On the Create repository page, do the following:

    1. In the Repository ID field, enter quickstart-repository.

    2. In the Region list, select .

    3. Click CREATE.

    4. Once the repository is created, you will see the Dataform service account. Copy and save the service account. You will need to use it later to assign necessary permissions.

    5. Ignore the warning regarding the role needed to execure queries. You will grant the necessary permissions in a later step using the service account name you copied in the prior step.

    6. Click Go to Repositories.

Note: If you get permission denied error related to API request wait for few minutes and create the repository again.

Test completed task

Click Check my progress to verify the objective.

Create a Dataform repository.

Task 2. Create and initialize a Dataform development workspace

  1. On the Dataform page, click on the quickstart-repository repository you just created.

  2. Click CREATE DEVELOPMENT WORKSPACE.

  3. In the Create development workspace window, do the following:

    1. In the Workspace ID field, enter quickstart-workspace.

    2. Click CREATE.

  4. Once created, click on the quickstart-workspace development workspace.

  5. Click INITIALIZE WORKSPACE.

Test completed task

Click Check my progress to verify the objective.

Create a Dataform workspace.

Task 3. Create a SQLX file for defining a view

In this section, you define a view that you will later use as a data source for a table.

  1. In the Files pane, next to definitions, click the More menu (the 3 vertical dots that appear to the right of definitions when you hover over it).

  2. Click Create file.

  3. In the Create new file pane, do the following:

    1. In the Add a file path field, enter definitions/quickstart-source.sqlx.

    2. Click CREATE FILE.

Define a view

  1. In the Files pane, expand the definitions folder.

  2. Click quickstart-source.sqlx.

  3. In the file, enter the following code snippet:

    config { type: "view" } SELECT "apples" AS fruit, 2 AS count UNION ALL SELECT "oranges" AS fruit, 5 AS count UNION ALL SELECT "pears" AS fruit, 1 AS count UNION ALL SELECT "bananas" AS fruit, 0 AS count

Task 4. Create a SQLX file for table definition

In the following sections, you define the table type in a SQLX file, and then write a SELECT statement to define the table structure within the same file.

  1. In the Files pane, next to definitions, click the More menu, and then select Create file.

  2. In the Add a file path field, enter definitions/quickstart-table.sqlx.

  3. Click CREATE FILE.

Define the table type, structure and dependencies

  1. In the Files pane, expand the definitions directory.

  2. Select quickstart-table.sqlx, and then enter the following table type and SELECT statement:

    config { type: "table" } SELECT fruit, SUM(count) as count FROM ${ref("quickstart-source")} GROUP BY 1
Note: You might notice an error note in the compiled queries section. Ignore the message and proceed to further steps to execute the workflow.

Task 5. Grant Dataform access to BigQuery

  1. In the Google Cloud console, on the Navigation menu (Navigation menu icon), select IAM & Admin > IAM.

  2. Click VIEW BY PRINCIPALS. Next, click GRANT ACCESS

  3. In the New principals field, enter the Dataform service account ID you copied in Task 1.

  4. In the Select a role drop-down list, select the BigQuery Job User role.

  5. Click Add another role, and then in the Select a role drop-down list, select the BigQuery Data Editor role.

  6. Click Add another role, and then in the Select a role drop-down list, select the BigQuery Data Viewer role.

  7. Click Save.

Test completed task

Click Check my progress to verify the objective. The new roles can take a couple of minutes to process, so if the check fails, wait a few minutes and try again.

Grant Dataform access to BigQuery.

Task 6. Execute the workflow

  1. In the Console, go to Navigation Menu > BigQuery > Dataform.

  2. Click on quickstart-repository to open the repository.

  3. Click on quickstart-workspace to open the development workspace.

  4. On the quickstart-workspace page, click START EXECUTION.

  5. In the Authentication section, select Execute with user credentials of student-xx-xxxxxxxxxxxx@qwiklabs.net.

  6. Click the drop down labeled Select actions to execute.

  7. Pick Select all from the drop down list. Now click OK

  8. Leave all other items as the default values.

  9. Click START EXECUTION at the bottom of the page.

  10. Accept the sign in as your student account. On the next page of the sign in scroll to the bottom and click Allow.

    Dataform uses the default repository settings to create the contents of your workflow in a BigQuery dataset called dataform.

Test completed task

Click Check my progress to verify the objective.

Create and execute the SQL workflow.

View execution logs

  1. On the quickstart-workspace page, click EXECUTIONS to open the Executions pane.

  2. To view details of your execution, click the latest execution.

End your lab

When you have completed your lab, click End Lab. Google Skills removes the resources you’ve used and cleans the account for you.

You will be given an opportunity to rate the lab experience. Select the applicable number of stars, type a comment, and then click Submit.

The number of stars indicates the following:

  • 1 star = Very dissatisfied
  • 2 stars = Dissatisfied
  • 3 stars = Neutral
  • 4 stars = Satisfied
  • 5 stars = Very satisfied

You can close the dialog box if you don't want to provide feedback.

For feedback, suggestions, or corrections, please use the Support tab.

Copyright 2026 Google LLC All rights reserved. Google and the Google logo are trademarks of Google LLC. All other company and product names may be trademarks of the respective companies with which they are associated.

Avant de commencer

  1. Les ateliers créent un projet Google Cloud et des ressources pour une durée déterminée.
  2. Les ateliers doivent être effectués dans le délai imparti et ne peuvent pas être mis en pause. Si vous quittez l'atelier, vous devrez le recommencer depuis le début.
  3. En haut à gauche de l'écran, cliquez sur Démarrer l'atelier pour commencer.

Utilisez la navigation privée

  1. Copiez le nom d'utilisateur et le mot de passe fournis pour l'atelier
  2. Cliquez sur Ouvrir la console en navigation privée

Connectez-vous à la console

  1. Connectez-vous à l'aide des identifiants qui vous ont été attribués pour l'atelier. L'utilisation d'autres identifiants peut entraîner des erreurs ou des frais.
  2. Acceptez les conditions d'utilisation et ignorez la page concernant les ressources de récupération des données.
  3. Ne cliquez pas sur Terminer l'atelier, à moins que vous n'ayez terminé l'atelier ou que vous ne vouliez le recommencer, car cela effacera votre travail et supprimera le projet.

Ce contenu n'est pas disponible pour le moment

Nous vous préviendrons par e-mail lorsqu'il sera disponible

Parfait !

Nous vous contacterons par e-mail s'il devient disponible

Un atelier à la fois

Confirmez pour mettre fin à tous les ateliers existants et démarrer celui-ci

Utilisez la navigation privée pour effectuer l'atelier

Le meilleur moyen d'exécuter cet atelier consiste à utiliser une fenêtre de navigation privée. Vous éviterez ainsi les conflits entre votre compte personnel et le compte temporaire de participant, qui pourraient entraîner des frais supplémentaires facturés sur votre compte personnel.