Skip to content
Gallery
databricks
Databricks Pack
Share
Explore
How to query your tables

icon picker
Query Table

How to use the query table
info

Steps to use the query table

1. Pull down the Query Table sync and drag in a “New Query”

Once you are inside of the Databricks pack interface, expand the Query option and once ready, drag in a New Query to your document.
A GIF is shown to the right to help you on this part

Screen Cast 2024-05-01 at 2.02.29 PM.gif

2. Define your query

Now that you have a table ready, you need to write your custom SQL query. While you can write the SELECT statement directly into the Query parameter of the sync options itself, best practice for readability is to write your SQL statement in a helper table and reference it in a formula.
Heres an example of a helper table with a sample SQL query. Try pressing
New Query
to add your own!
SQL Queries
Tag
Query
1
Customer Query
SELECT email as customer_email, CONCAT(first_name, ' ', last_name) as customer, county
FROM customers
WHERE county like '%la'
LIMIT 2000
There are no rows in this table

3. Input your Warehouse, query and begin sync

Screen Cast 2024-05-01 at 2.11.33 PM.gif
On the table you dragged in there should be a blue Choose what to sync button . When you press that, a scroll-over from the left hand side will pop up and allow you to choose a warehouse on which to run your query along with a space to input your query itself.
The Warehouse will auto-complete and pull all warehouses available to you
For the query you are going to reference it with an @ tag and search for the value in the gray Tag column. In this case it will be Customer Query . Once you locate that you need to select the query statement itself.
Here is another GIF to help you out on this part:
Once you have inputted both your query and warehouse, press the Begin Sync button!
Its possible, depending on the size of your query that the sync will fail. If this is the case, try using the option or reach out to support at
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.