Preview changes locally
The Preview local changes drawer.
Overview
Use the menu at the bottom to preview changes locally.
Exploring the options
The Preview Local Changes menu offers the following functionalities:
- Preview data
- View the compiled query of your asset
Data query preview
Shortcut: COMMAND + ENTER
To preview a partial SQL query, select the portion you want to preview (available in both Data Catalog and Code mode) and use the same shortcut as above or right click to preview.
Use CMD/CTRL + ENTER or right click to either preview the query or parts of it.
Preview 100 rows vs Full preview
Choose to either preview the first 100 rows or opt for a full preview, which materializes the previewed query as a table inside the Data Warehouse (DWH) with a 24-hour time-to-live period.
Data query options: first 100 rows or full preview.
Utilizing the full preview feature grants you the capability to apply filters across all rows, transcending the initial 100-row limit. This becomes possible once the asset has been materialized as a table. This feature is particularly useful for verifying specific row data against your expectations before committing changes and building your asset.
Data query filter in action.
Group by preview data
You can aggregate results and group them by specific columns in the preview. Click on the three dots of any column for more actions, navigate to the second tab with three horizontal lines (aggregations), and select Group By <column_name>
.
Group by the resultset.
Pivot preview data
You can pivot the preview result set. Click on the <n>/<m>
columns label and toggle Pivot on. You can now select the Row Groups, Values, and Column Labels by dragging columns from the list.
Pivot the resultset.
Warehouse selection for previewing data [Snowflake only]
For Snowflake-connected spaces, you can select from the available warehouses to preview data.
Select warehouse to use when previewing data.
Compiled query
Shortcut: COMMAND + ALT + ENTER
To compile a partial SQL query, select the portion you want to compile (available in both Data Catalog and Code mode) and use the same shortcut as above or right click to compile.
Use CMD/CTRL + ALT + ENTER or right click to either compile the query or parts of it.
In this section, view the compiled query utilizing the underlying data warehouse tables and views. Learn more about the naming conventions utilized for branches and assets.
FAQ
The preview is long running or timing out. How can I improve the performance?
- Review the model logic. Simplify by breaking down complex transformations or excessive joins into multiple models.
- Consider using a different materialization type for your model and/or upstream models.
- Optimize SQL queries. While specific optimizations depend on the warehouse, general improvements include using
GROUP BY
instead ofDISTINCT
, orUNION ALL
instead ofUNION
. - Utilize warehouse-specific features, such as partitioning and clustering in BigQuery.
Note: The above solutions are particularly helpful in addressing common issues like the compilation memory exhausted
error in Snowflake. However, different warehouses may have unique errors and solutions.