Test queries using the sandbox

The sandbox lets you test queries on synthetic data before running them on real data. Sandbox queries run faster and aren't subject to Ads Data Hub's privacy restrictions. Using the sandbox, you can:

  • Test queries before running them on your own data.
  • Iterate on draft queries before finalizing them.
  • Explore data within Ads Data Hub.

Sandbox privacy restrictions

The sandbox is the only place in Ads Data hub where you can:

  • Run queries using SELECT *. This allows you to see what kind of data your queries will contain in production.
  • Run a series of similar queries without compromising data granularity. Doing this would typically result in dropped rows. To mitigate against dropped rows in production, use a row merge configuration.

Writing and running sandbox queries

Writing and running queries using the sandbox is almost identical to using ADH in a real-world setting. The key differences are that you must select the sandbox role when running your query, and you may see privacy warnings that don't apply to your query.

Write a sandbox query

  1. Navigate to the My Queries tab.
  2. Click +Create New Query.
    1. Give your query a name.
    2. Write BigQuery compatible SQL arguments. The query validator will turn red if your query violates our privacy checks, but you can still run it via the sandbox. For explanation, read The query validator is red below.
  3. Optionally, give your query parameters.
  4. Optionally, add a merge column to see dropped results.
  5. Click Save.

The query validator is red

The query validator may turn red after you've written your sandbox query. This could be due to:

  • A violation of privacy checks: Even though your query violates privacy checks and can't be run on real user data, it can be run using the sandbox.
  • Invalid SQL: If the SQL you've written isn't semantically correct, it can't be run in Ads Data Hub.

Run a sandbox query

  1. Navigate to the My Jobs tab.
  2. Select the query type.
  3. Select the query to run.
  4. Select ADH Sandbox Customer from the Ads data from dropdown.
  5. Select the table where your query results should be saved.
  6. Enter start and end dates between 2018-08-18 00:00:00 and 2018-09-17 23:59:59.
  7. Click Start.