Guide: Using Google BigQuery with Databox
BigQuery connections are available on the Professional and Performer plans. Request a free trial of BigQuery by following
How to prepare your BigQuery database
SELECT time_ts AS date, score, author FROM [bigquery-public-data:hacker_news.stories] ORDER BY score DESC LIMIT 5;
Enter the Service account name and choose an appropriate Role for the user. All BigQuery Users can run queries.
Learn more about security and best practices for BigQuery here.
Click Create to create the new service account key. From here, we'll be able to download the credentials file as a JSON file. We'll save this in a folder to use later when we connect BigQuery to Databox.
How to connect BigQuery to Databox
Once our Database is properly prepared, we'll connect it to Databox.
To connect BigQuery to Databox, go to Data Sources > + New connection. Type BigQuery in the search bar and click on the green Connect button.
This will open the Activation window, which is where you will be prompted to enter your connection data and authorize the Databox app. Paste the JSON Credentials file contents into the appropriate field.
We’ll be using the Legacy SQL syntax, so we'll leave the Legacy SQL checkmark selected. Standard SQL and partitioned tables are not currently supported.
Click the green Activate button to complete the connection process. If BigQuery was successfully connected, the Activation window will close shortly and you'll see a Connected notice. If you have difficulty connecting, review the following:
- Make sure all data is entered correctly and the appropriate roles are set
- One column must contain Date values. You can cast any column to name “date” using “AS” SQL syntax
- One column must contain numeric (Metric) values
How to use the Metric Builder for BigQuery
The Metric Builder for BigQuery allows you to create Custom Metrics using data from your Database to use in Databoards, Alerts, Goals, etc. Learn more about the Metric Builder for BigQuery here.
- Standard SQL and partitioned tables are not currently supported.
- Query results are limited to 10,000 rows. If you expect your query to return over 10,000 rows or if you're not sure how many rows will be returned, be sure to LIMIT the query. If you need more than 10,000 rows in order to successfully report on your Google BIgQuery data in Databox, feel free to submit your request on our Roadmap here.
- The query must contain a column named "Date." If you need to, use AS in your SELECT statement to satisfy this requirement
- One column should always contain the Metric Value
- "Null" values will not be recognized. Use a COALESCE function when needed. Learn more here.