RBENREJEB@RBR-OS:/OPT/DATAFORM-INTELLIJ-PLUGIN/FEATURES/COMPILED-PREVIEW$ CAT README
FEATURES
Compiled preview
Google Cloud Dataform Plugin for IntelliJ · Features
Each SQLX file opens in a split editor: your source on the left, and a preview of what Dataform compiles it to on the right. The preview follows the background compilation, so it stays in sync as you edit.
Views
The toolbar at the top right of the editor switches the preview between its views:
| View | Content |
|---|---|
| Query | The compiled queries of the file’s actions, with their assertions and estimated cost. |
| Schema | The output columns of each action. Assertions are listed without columns. |
| Lineage | The direct dependencies of the file. See Lineage. |
| Test | For a unit test file: the compiled test query and the expected output. See Unit tests. |
The Editor only, Editor and preview and Preview only buttons next to them change the split.
Query view
The header shows how many actions the file defines, when it was compiled, and the Estimated bytes and cost of all its queries.
Each action has its own block, titled with its full table name and type, with its bytes and cost and three buttons: Copy SQL, Run Query and Open in BigQuery Console. In the block:
- the Query tab shows the compiled SQL, split into Pre-operations, Incremental
pre-operations, the query and Post-operations, with
${ref()}replaced by full table names; - the Assertions tab lists the assertions generated from the
config { }block (uniqueKey,nonNull,rowConditions, …), each with its query, cost and buttons.
Drag the bottom edge of a SQL block to resize it; each block keeps its height. A query that failed its BigQuery dry run shows a BigQuery dry run failed banner with the error and Copy error; an action that did not compile shows its compilation error instead. See Errors and build.
Cost estimates
The bytes and cost of each query come from a BigQuery dry run. Hover a cost to see how it was priced: the location, the price per TiB and where the price comes from.
The price source and the currency are set in the plugin settings. See BigQuery cost.
Schema view
The Schema view lists the output columns of each action as a tree, with their type, mode and
description. Nested STRUCT / RECORD fields can be expanded. The file’s assertions are listed too,
but the plugin does not read their schema, so they show No schema.
- Click the copy icon next to a column to copy its path, for example
customer.emailfor a nested field. - Copy Column Names copies the list of top-level columns.
- Refresh Schema runs the dry run again.
Schemas and costs are resolved through BigQuery dry runs, so they need the Google Cloud sign-in and an active repository (see Configuration). Until then, the preview shows Sign in to estimate.
Lineage view
The Lineage view draws the direct dependencies of the file: its actions, the actions they read from and the actions that read from them. The file’s action is selected, with its edges in blue. The header names the file, and the status bar counts the nodes.
- The Dataform | Knowledge Catalog switch in the header picks the source. With Knowledge Catalog, the view shows the tables of the file and the tables BigQuery recorded directly upstream and downstream of them. See Knowledge Catalog lineage.
- Double-click a node to open its file.
- Right-click a node for Open SQLX, Run, Focus on lineage and Copy name.
- Layout direction lays the graph out left to right or top to bottom.
- Open full lineage opens the project lineage on the same source, with the tables of the file marked, and its filters, search and column lineage. See Lineage.
The view needs a compiled project. Until then it reads No lineage for this file. Compile the Dataform project.
Test view
A unit test file (type: "test") has a single Test view in place of Query, Schema and
Lineage:
- Test query: the query of the tested dataset run on your input rows, each
ref()to an input replaced by theSELECTof its input block; - Expected output: the query of the rows the test expects;
- Compilation errors: the errors of a test that does not compile, also shown in a banner above the sections.
Each section has Copy. Run test query in the editor toolbar runs the test query or the expected output in BigQuery, to see the rows the test compares. To run the test itself, see Unit tests.