Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add exports content and rn #4689

Merged
merged 150 commits into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
150 commits
Select commit Hold shift + click to select a range
f1e034d
new page
mirnawong1 Dec 6, 2023
ab3b457
fleshing out exports
mirnawong1 Dec 18, 2023
f4a23e8
tweak
mirnawong1 Dec 18, 2023
7caa486
fix link
mirnawong1 Dec 18, 2023
95d5a75
tweaks
mirnawong1 Dec 20, 2023
e397303
tweaks
mirnawong1 Dec 21, 2023
0755141
Merge branch 'current' into sl-exports
mirnawong1 Dec 21, 2023
774620e
fix error
mirnawong1 Dec 21, 2023
3240c2f
remove comments and add them to pr
mirnawong1 Dec 21, 2023
f65f6ec
clarify header
mirnawong1 Dec 21, 2023
ba5f0e8
Merge branch 'current' into sl-exports
mirnawong1 Jan 24, 2024
ef3ce0d
udpates
mirnawong1 Jan 24, 2024
1bf7e5b
add prerqs
mirnawong1 Jan 24, 2024
21071f2
This branch was auto-updated!
github-actions[bot] Jan 24, 2024
b69964d
This branch was auto-updated!
github-actions[bot] Jan 24, 2024
8d180bb
This branch was auto-updated!
github-actions[bot] Jan 24, 2024
6f8840a
This branch was auto-updated!
github-actions[bot] Jan 25, 2024
c7cf7d0
This branch was auto-updated!
github-actions[bot] Jan 25, 2024
6bc4b9a
This branch was auto-updated!
github-actions[bot] Jan 25, 2024
e1d7851
This branch was auto-updated!
github-actions[bot] Jan 25, 2024
0a6da02
This branch was auto-updated!
github-actions[bot] Jan 25, 2024
93f7d99
This branch was auto-updated!
github-actions[bot] Jan 25, 2024
27a9373
This branch was auto-updated!
github-actions[bot] Jan 26, 2024
46facb7
This branch was auto-updated!
github-actions[bot] Jan 26, 2024
f97f4cb
This branch was auto-updated!
github-actions[bot] Jan 26, 2024
137f07d
This branch was auto-updated!
github-actions[bot] Jan 26, 2024
68d95ed
This branch was auto-updated!
github-actions[bot] Jan 26, 2024
834d6f7
This branch was auto-updated!
github-actions[bot] Jan 26, 2024
7bd9671
This branch was auto-updated!
github-actions[bot] Jan 29, 2024
a143df3
This branch was auto-updated!
github-actions[bot] Jan 29, 2024
0792e56
This branch was auto-updated!
github-actions[bot] Jan 29, 2024
355c860
This branch was auto-updated!
github-actions[bot] Jan 29, 2024
c2b24e7
This branch was auto-updated!
github-actions[bot] Jan 29, 2024
5cbfdcf
This branch was auto-updated!
github-actions[bot] Jan 29, 2024
6a3aa62
This branch was auto-updated!
github-actions[bot] Jan 30, 2024
486643e
This branch was auto-updated!
github-actions[bot] Jan 30, 2024
934a4a0
This branch was auto-updated!
github-actions[bot] Jan 30, 2024
4956ded
This branch was auto-updated!
github-actions[bot] Jan 30, 2024
5d91da2
This branch was auto-updated!
github-actions[bot] Jan 30, 2024
719407b
This branch was auto-updated!
github-actions[bot] Jan 30, 2024
50aee03
This branch was auto-updated!
github-actions[bot] Jan 30, 2024
221b4d8
This branch was auto-updated!
github-actions[bot] Jan 30, 2024
13b6001
This branch was auto-updated!
github-actions[bot] Jan 30, 2024
c939c13
This branch was auto-updated!
github-actions[bot] Jan 30, 2024
06f2d06
This branch was auto-updated!
github-actions[bot] Jan 30, 2024
1c354e9
This branch was auto-updated!
github-actions[bot] Jan 31, 2024
107457c
This branch was auto-updated!
github-actions[bot] Jan 31, 2024
3e0d5b6
This branch was auto-updated!
github-actions[bot] Jan 31, 2024
b26fe2c
This branch was auto-updated!
github-actions[bot] Jan 31, 2024
6e99d50
This branch was auto-updated!
github-actions[bot] Feb 1, 2024
e02322d
This branch was auto-updated!
github-actions[bot] Feb 1, 2024
293f268
This branch was auto-updated!
github-actions[bot] Feb 1, 2024
0317b39
This branch was auto-updated!
github-actions[bot] Feb 1, 2024
8193866
This branch was auto-updated!
github-actions[bot] Feb 1, 2024
7475cb2
This branch was auto-updated!
github-actions[bot] Feb 1, 2024
c9dec2c
This branch was auto-updated!
github-actions[bot] Feb 2, 2024
5fbbe66
This branch was auto-updated!
github-actions[bot] Feb 2, 2024
bca0707
This branch was auto-updated!
github-actions[bot] Feb 2, 2024
5cee25b
This branch was auto-updated!
github-actions[bot] Feb 3, 2024
f2cdfc5
update exports docs
Jstein77 Feb 5, 2024
46facba
Merge branch 'current' into sl-exports
mirnawong1 Feb 5, 2024
c066851
This branch was auto-updated!
github-actions[bot] Feb 5, 2024
ab27da3
This branch was auto-updated!
github-actions[bot] Feb 5, 2024
4362c65
adding tweaks
mirnawong1 Feb 5, 2024
ad04ad9
This branch was auto-updated!
github-actions[bot] Feb 5, 2024
54bbadf
more tweaks
mirnawong1 Feb 5, 2024
15a7d99
This branch was auto-updated!
github-actions[bot] Feb 5, 2024
aaab9a4
tweaks
mirnawong1 Feb 5, 2024
0431cf0
This branch was auto-updated!
github-actions[bot] Feb 5, 2024
1def6ff
tweaks
mirnawong1 Feb 5, 2024
e7662ac
Merge branch 'sl-exports' of https://github.com/dbt-labs/docs.getdbt.…
mirnawong1 Feb 5, 2024
40ff44b
date
mirnawong1 Feb 5, 2024
d22b1e4
changes
mirnawong1 Feb 6, 2024
65eebd5
final tweaks
mirnawong1 Feb 6, 2024
c235033
This branch was auto-updated!
github-actions[bot] Feb 6, 2024
a27d1a7
Update website/docs/docs/dbt-versions/release-notes/72-Feb-2024/expor…
mirnawong1 Feb 6, 2024
253deff
This branch was auto-updated!
github-actions[bot] Feb 6, 2024
c5ef24a
This branch was auto-updated!
github-actions[bot] Feb 6, 2024
95ed734
This branch was auto-updated!
github-actions[bot] Feb 6, 2024
24ec72c
update to sentence case
mirnawong1 Feb 6, 2024
5dc3551
sentence case
mirnawong1 Feb 6, 2024
1952b65
update production steps to use env variable
Jstein77 Feb 7, 2024
197588a
Update website/docs/docs/dbt-versions/release-notes/72-Feb-2024/expor…
mirnawong1 Feb 7, 2024
0e4d331
Update website/docs/docs/dbt-versions/release-notes/72-Feb-2024/expor…
mirnawong1 Feb 7, 2024
221eb89
Update website/docs/docs/dbt-versions/release-notes/72-Feb-2024/expor…
mirnawong1 Feb 7, 2024
cd8c93c
Update website/docs/docs/use-dbt-semantic-layer/exports.md
mirnawong1 Feb 7, 2024
5744541
Update website/docs/docs/use-dbt-semantic-layer/exports.md
mirnawong1 Feb 7, 2024
9876126
Update website/docs/docs/use-dbt-semantic-layer/exports.md
mirnawong1 Feb 7, 2024
25ccd8b
Update website/docs/docs/use-dbt-semantic-layer/exports.md
mirnawong1 Feb 7, 2024
0ee9ef8
Update website/docs/docs/use-dbt-semantic-layer/exports.md
mirnawong1 Feb 7, 2024
7616d7d
Update website/docs/docs/use-dbt-semantic-layer/exports.md
mirnawong1 Feb 7, 2024
0092c30
Update website/docs/docs/use-dbt-semantic-layer/exports.md
mirnawong1 Feb 7, 2024
ca81419
Update website/docs/docs/use-dbt-semantic-layer/exports.md
mirnawong1 Feb 7, 2024
23cb79b
Update website/docs/docs/use-dbt-semantic-layer/exports.md
mirnawong1 Feb 7, 2024
419fd56
Update website/docs/docs/use-dbt-semantic-layer/exports.md
mirnawong1 Feb 7, 2024
37fbfe5
Update website/docs/docs/use-dbt-semantic-layer/exports.md
mirnawong1 Feb 7, 2024
1344a2b
Update website/docs/docs/use-dbt-semantic-layer/exports.md
mirnawong1 Feb 7, 2024
0bc393a
Update website/docs/docs/use-dbt-semantic-layer/exports.md
mirnawong1 Feb 7, 2024
63fbfc7
Update website/docs/docs/use-dbt-semantic-layer/exports.md
mirnawong1 Feb 7, 2024
8c4e0b9
Update website/docs/docs/use-dbt-semantic-layer/exports.md
mirnawong1 Feb 7, 2024
ee55c1c
Update website/docs/docs/use-dbt-semantic-layer/exports.md
mirnawong1 Feb 7, 2024
cbe278e
Update website/docs/docs/use-dbt-semantic-layer/exports.md
mirnawong1 Feb 7, 2024
6d46173
Update website/docs/docs/use-dbt-semantic-layer/exports.md
mirnawong1 Feb 7, 2024
efacaad
Update website/docs/docs/use-dbt-semantic-layer/exports.md
mirnawong1 Feb 7, 2024
ccfc697
Update website/docs/docs/use-dbt-semantic-layer/exports.md
mirnawong1 Feb 7, 2024
d226bca
Update website/docs/docs/use-dbt-semantic-layer/exports.md
mirnawong1 Feb 7, 2024
93a65f2
Update website/docs/docs/use-dbt-semantic-layer/exports.md
mirnawong1 Feb 7, 2024
33c2861
Update website/docs/docs/use-dbt-semantic-layer/exports.md
mirnawong1 Feb 7, 2024
958b223
Update website/docs/docs/use-dbt-semantic-layer/exports.md
mirnawong1 Feb 7, 2024
3972ee0
Update website/docs/docs/use-dbt-semantic-layer/exports.md
mirnawong1 Feb 7, 2024
ef51d6c
Update website/docs/docs/use-dbt-semantic-layer/exports.md
mirnawong1 Feb 7, 2024
8e628d8
Update website/docs/docs/use-dbt-semantic-layer/exports.md
mirnawong1 Feb 7, 2024
2bcf387
Update website/docs/docs/use-dbt-semantic-layer/exports.md
mirnawong1 Feb 7, 2024
f4b1e9c
Update website/docs/docs/use-dbt-semantic-layer/exports.md
mirnawong1 Feb 7, 2024
414a681
Update website/docs/docs/use-dbt-semantic-layer/exports.md
mirnawong1 Feb 7, 2024
4820776
Update website/docs/docs/use-dbt-semantic-layer/exports.md
mirnawong1 Feb 7, 2024
aca40d0
Update website/docs/docs/use-dbt-semantic-layer/exports.md
mirnawong1 Feb 7, 2024
42df69b
Update website/docs/docs/use-dbt-semantic-layer/exports.md
mirnawong1 Feb 7, 2024
e9b9bf0
Update website/docs/docs/use-dbt-semantic-layer/exports.md
mirnawong1 Feb 7, 2024
291371e
Update website/docs/docs/use-dbt-semantic-layer/exports.md
mirnawong1 Feb 7, 2024
5a64948
Update website/docs/docs/use-dbt-semantic-layer/exports.md
mirnawong1 Feb 7, 2024
2965d39
Update website/docs/docs/use-dbt-semantic-layer/exports.md
mirnawong1 Feb 7, 2024
03f8326
Update website/docs/docs/use-dbt-semantic-layer/exports.md
mirnawong1 Feb 7, 2024
cefdddd
Update website/docs/docs/use-dbt-semantic-layer/exports.md
mirnawong1 Feb 7, 2024
6722d74
Update website/docs/docs/use-dbt-semantic-layer/exports.md
mirnawong1 Feb 7, 2024
ac095d0
Update website/docs/docs/use-dbt-semantic-layer/exports.md
mirnawong1 Feb 7, 2024
d143512
Update website/docs/docs/use-dbt-semantic-layer/exports.md
mirnawong1 Feb 7, 2024
4ad1518
Update website/docs/docs/use-dbt-semantic-layer/exports.md
mirnawong1 Feb 7, 2024
962f946
Update website/docs/docs/use-dbt-semantic-layer/exports.md
mirnawong1 Feb 7, 2024
e053c4b
Update website/docs/docs/use-dbt-semantic-layer/exports.md
mirnawong1 Feb 7, 2024
b6a2b93
Update website/docs/docs/dbt-versions/release-notes/72-Feb-2024/expor…
mirnawong1 Feb 7, 2024
2dfa391
udpates
mirnawong1 Feb 7, 2024
2cbb9fa
updates
mirnawong1 Feb 7, 2024
a912454
clarify and update screenshot
mirnawong1 Feb 7, 2024
60fbeb7
Update website/docs/docs/use-dbt-semantic-layer/exports.md
mirnawong1 Feb 7, 2024
cb838c0
This branch was auto-updated!
github-actions[bot] Feb 7, 2024
b5a10d5
Update website/docs/docs/use-dbt-semantic-layer/exports.md
mirnawong1 Feb 7, 2024
757c915
Update website/docs/docs/use-dbt-semantic-layer/exports.md
mirnawong1 Feb 7, 2024
0b552b9
Update website/docs/docs/use-dbt-semantic-layer/exports.md
mirnawong1 Feb 7, 2024
a4994a1
Update website/docs/docs/use-dbt-semantic-layer/exports.md
mirnawong1 Feb 7, 2024
af61bf7
Update website/docs/docs/use-dbt-semantic-layer/exports.md
mirnawong1 Feb 7, 2024
f1fefcb
Update website/docs/docs/use-dbt-semantic-layer/exports.md
mirnawong1 Feb 7, 2024
ec453fa
Update website/docs/docs/use-dbt-semantic-layer/exports.md
mirnawong1 Feb 7, 2024
8dedd16
Update website/docs/docs/use-dbt-semantic-layer/exports.md
mirnawong1 Feb 7, 2024
3c7e871
Update website/docs/docs/use-dbt-semantic-layer/exports.md
mirnawong1 Feb 7, 2024
74fdfaf
Update website/docs/docs/use-dbt-semantic-layer/exports.md
mirnawong1 Feb 7, 2024
e33ab6e
Update website/docs/docs/use-dbt-semantic-layer/exports.md
mirnawong1 Feb 7, 2024
b15b37d
Update website/docs/docs/use-dbt-semantic-layer/exports.md
mirnawong1 Feb 7, 2024
7e62168
Update website/docs/docs/use-dbt-semantic-layer/exports.md
mirnawong1 Feb 7, 2024
ffc7526
Update exports.md
mirnawong1 Feb 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions website/dbt-versions.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,6 @@ exports.versionedPages = [
"page": "reference/resource-configs/grants",
"firstVersion": "1.2",
},
{
"page": "docs/build/saved-queries",
"firstVersion": "1.7",
},
{
"page": "reference/resource-configs/on_configuration_change",
"firstVersion": "1.6",
Expand Down
2 changes: 1 addition & 1 deletion website/docs/docs/build/about-metricflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Before you start, consider the following guidelines:
- Define metrics in YAML and query them using these [new metric specifications](https://github.com/dbt-labs/dbt-core/discussions/7456).
- You must be on [dbt version](/docs/dbt-versions/upgrade-core-in-cloud) 1.6 or higher to use MetricFlow.
- Use MetricFlow with Snowflake, BigQuery, Databricks, Postgres (dbt Core only), or Redshift.
- Discover insights and query your metrics using the [dbt Semantic Layer](/docs/use-dbt-semantic-layer/dbt-sl) and its diverse range of [available integrations](/docs/use-dbt-semantic-layer/avail-sl-integrations). You must have a dbt Cloud account on the [Team or Enterprise plan](https://www.getdbt.com/pricing/).
- Discover insights and query your metrics using the [dbt Semantic Layer](/docs/use-dbt-semantic-layer/dbt-sl) and its diverse range of [available integrations](/docs/use-dbt-semantic-layer/avail-sl-integrations).
mirnawong1 marked this conversation as resolved.
Show resolved Hide resolved

## MetricFlow

Expand Down
4 changes: 2 additions & 2 deletions website/docs/docs/build/build-metrics-intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ MetricFlow allows you to:
<div className="grid--3-col">

<Card
title="Get started with the dbt Semantic Layer"
title="Get started with the dbt Semantic Layer and MetricFlow"
body="Use this guide to build and define metrics with MetricFlow, set up the dbt Semantic Layer, and query them using downstream tools."
link="/docs/build/sl-getting-started"
icon="dbt-bit"/>

<Card
title="About MetricFlow"
body="Understand MetricFlow's core concepts, key principles, and how to use this powerful tool."
body="Understand MetricFlow's core concepts, how to use joins, how to save commonly used queries, and what commands are available."
link="/docs/build/about-metricflow"
icon="dbt-bit"/>

Expand Down
39 changes: 31 additions & 8 deletions website/docs/docs/build/saved-queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,18 @@ tags: [Metrics, Semantic Layer]

Saved queries are a way to save commonly used queries in MetricFlow. You can group metrics, dimensions, and filters that are logically related into a saved query.

To define a saved query, refer to the following specification:
They are distinct from [Exports](/docs/use-dbt-semantic-layer/exports), which are scheduled and executed saved queries using [dbt's job scheduler](/docs/deploy/job-scheduler).

Parameter | Description | Type |
| --------- | ----------- | ---- |
| `name` | The name of the metric. | Required |
| `description` | The description of the metric. | Optional |
| `query_params` | The query parameters for the saved query: `metrics`, `group_by`, and `where`. | Required |
| Feature | Saved queries | Exports |
|--------------|----------------|------------|
| **Availability** | Available in both dbt Core and dbt Cloud. | Available to dbt Cloud users on Team and Enterprise plans. |
| **Purpose** | To define and manage common Semantic Layer queries. | Automatically runs saved queries and materializes them within your data platform using dbt's job scheduler. |
| **Usage** | For organizing and reusing queries within dbt projects. | For materializing query results in the data platform. |

mirnawong1 marked this conversation as resolved.
Show resolved Hide resolved
The following is an example of a saved query:

All metrics in a saved query need to use the same dimensions in the `group_by` or `where` clauses.

```yaml
saved_queries:
- name: p0_booking
Expand All @@ -33,6 +35,27 @@ saved_queries:
- "{{ Dimension('listing__capacity_latest') }} > 3"
```

### FAQs
## Parameters

To define a saved query, refer to the following parameters:

| Parameter | Type | Required | Description |
|-------|---------|----------|----------------|
| `name` | String | Required | Name of the saved query object. |
| `description` | String | Required | A description of the saved query. |
| `query_params` | Structure | Required | Contains the query parameters. |
| `query_params::metrics` | List or String | Optional | A list of the metrics to be used in the query as specified in the CLI. |
| `query_params::group_bys` | List or String | Optional | A list of the Entities and Dimensions to be used in the query, which include the `Dimension` or `TimeDimension`. |
| `query_params::where` | LList or String or String | Optional | A list of string which may include the `Dimension` or `TimeDimension` objects. |
| `exports` | List or Structure | Optional | A list of exports to be specified with the exports structure. |
| `exports::name` | String | Required | Name of the export object. |
| `exports::config` | List or Structure | Required | A config section for any parameters specifying the export. |
| `exports::config::export_as` | String | Required | The type of export to run. Options include table or view currently and cache in the near future. |
| `exports::config` | String | Optional | The schema used for creating the table or view. This option cannot be used for caching. |
| `exports::config` | String | Optional | The table alias to use to write the table or view. This option cannot be used for caching. |


## Related docs

* All metrics in a saved query need to use the same dimensions in the `group_by` or `where` clauses.
- [Exports](/docs/use-dbt-semantic-layer/exports)
- [Set up the dbt Semantic Layer](/docs/use-dbt-semantic-layer/setup-sl)
2 changes: 1 addition & 1 deletion website/docs/docs/deploy/deploy-jobs.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ You can use deploy jobs to build production data assets. Deploy jobs make it eas
- Job run details, including run timing, [model timing data](#model-timing), and [artifacts](/docs/deploy/artifacts)
- Detailed run steps with logs and their run step statuses

You can create a deploy job and configure it to run on [scheduled days and times](#schedule-days) or enter a [custom cron schedule](#custom-cron-schedules).
You can create a deploy job and configure it to run on [scheduled days and times](#schedule-days) or enter a [custom cron schedule](#custom-cron-schedules).


## Prerequisites
Expand Down
1 change: 1 addition & 0 deletions website/docs/docs/deploy/deployment-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ dbt Cloud offers the easiest and most reliable way to run your dbt project in pr
- Identify the root cause of failures in deployment environments
- Maintain high-quality code and data in production
- Gain visibility into the health of deployment jobs, models, and tests
- Uses [exports](/docs/use-dbt-semantic-layer/exports) to materialize [saved queries](/docs/build/saved-queries) in your data platform for reliable and fast metric reporting

Before continuing, make sure you understand dbt's approach to [deployment environments](/docs/deploy/deploy-environments).

Expand Down
6 changes: 6 additions & 0 deletions website/docs/docs/use-dbt-semantic-layer/dbt-sl.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ plan="dbt Cloud Team or Enterprise"
link="/docs/use-dbt-semantic-layer/setup-sl"
icon="dbt-bit"/>

<Card
title="Materialize queries with Exports"
body="Use Exports to materialize saved queries within the data platform on a schedule."
link="/docs/use-dbt-semantic-layer/exports"
icon="dbt-bit"/>

<Card
title="Architecture"
body="Learn about the powerful components that make up the dbt Semantic Layer."
Expand Down
121 changes: 121 additions & 0 deletions website/docs/docs/use-dbt-semantic-layer/exports.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
---
title: "Exports"
description: "Use Exports to materialize tables to the data platform on a schedule."
sidebar_label: "Materialize with Exports"
---

Exports in the dbt Semantic Layer extends the [saved queries](/docs/build/saved-queries) functionality:

- Exports enable you to materialize and automate these queries within your data platform.
mirnawong1 marked this conversation as resolved.
Show resolved Hide resolved
- Exports uses the dbt Cloud job scheduler to execute saved queries for reliable and fast data reporting.
mirnawong1 marked this conversation as resolved.
Show resolved Hide resolved

While saved queries are a way to save and reuse commonly used queries in MetricFlow, Exports takes this a step further by using the MetricFlow server to materialize these queries as data tables of views using the dbt Cloud job scheduler.
mirnawong1 marked this conversation as resolved.
Show resolved Hide resolved

| Feature | Exports | Saved queries |
|-----------|-----------|----------------|
| **Availability** | Available to dbt Cloud users on [Team or Enterprise](https://www.getdbt.com/pricing/) plans, on dbt versions 1.7 or higher.| Available in both dbt Core and dbt Cloud. |
| **Purpose** | To schedule and run saved queries as part of [dbt's job scheduler](/docs/deploy/job-scheduler). | To define and manage common Semantic Layer queries in YAML, which includes metrics and dimensions. |
| **Usage** | Automatically runs saved queries and materializes them within your data platform. Exports count towards [queried metrics](/docs/cloud/billing#what-counts-as-a-queried-metric) usage. <br /><br />**Example**: Creating a weekly aggregated table for active user metrics, automatically updated and stored in the data platform. | Used for organizing and reusing common MetricFlow queries within dbt projects.<br /><br />**Example**: Standardizing a frequently used revenue calculation across multiple reports. | For materializing query results in the data platform. |
| **Integration** | Must have the dbt Semantic Layer configured in your dbt project.<br /><br />Tightly integrated with the [MetricFlow Server](/docs/use-dbt-semantic-layer/sl-architecture#components) and dbt Cloud's job scheduler. | Integrated into dbt DAG and managed alongside other dbt nodes. |
| **Configuration** | Configured within dbt Cloud environment and job scheduler settings. | Defined in YAML format within dbt project files. |
mirnawong1 marked this conversation as resolved.
Show resolved Hide resolved

## Define exports

Exports are essentially saved queries that you can schedule and execute using [dbt's job scheduler](/docs/deploy/job-scheduler) capabilities. Exports include the following materialization types:

mirnawong1 marked this conversation as resolved.
Show resolved Hide resolved
- `table` (available now)
- and `window_table`, `incremental_table`, and `file` (coming soon)

You can define Exports in a YAML format in the same file as saved queries:

```yaml
mirnawong1 marked this conversation as resolved.
Show resolved Hide resolved
saved_queries:
- name: my_query
description: null
query_params:
metrics:
- null
group_bys:
- TimeDimension()
- ...
where:
- null
exports:
- name: my_query
config:
export_as: table # options: table, view
schema: my_schema # [optional - DEFAULT to deployment schema]
alias: some_table_name # [optional - DEFAULT to export name]
```

## Parameters

By default all exports are run for a saved query. You can select a specific export with the `select` flag or you can specify a new export using the `export-as` flag. The Job scheduler runs the equivalent of` dbt sl export --saved-query sq_name`.

| Parameters | Type | Required | Description |
| ------- | --------- | ---------- | ---------------- |
| `saved-query` | String | Required | A name of a saved query that could be used. |
mirnawong1 marked this conversation as resolved.
Show resolved Hide resolved
| `select` | List or String | Optional | Names of exports to be selected from the saved query. |
mirnawong1 marked this conversation as resolved.
Show resolved Hide resolved
| `exclude` | String | Optional | Not the names of exports to be selected from the saved query. |
| `export-as` | String | Optional | Type of export to create from the export_as types available in the config. |
| `schema` | String | Optional | Schema to use for creating the table or view. |
| `alias` | String | Optional | Table alias to use to write the table or view. |

## Schedule Exports

Exports in dbt are effectively integrated with your data models and metrics, allowing you to automate and materialize saved queries using the dbt Cloud job scheduler. These exports, along with saved queries, are treated as standard dbt models and are executed as part of the dbt <Term id="dag" />, following model builds where dependencies exist.

To execute exports using the job scheduler:

- Create a [deploy job](/docs/deploy/deploy-jobs) in dbt Cloud.
- Use the built-in `dbt build` command to execute exports and saved queries.
- Note that although you can selectively run specific saved queries, this level of selection isn't available for individual exports. However, you can always create a different saved query if you want to separate exports. WHAT'S A SAMPLE QUERY? IS IT `export-as export_name` OR `dbt sl export --saved-query sq_name`
- After dbt completes building the models, the MetricFlow Server processes the exports, compiles the necessary datasets, and executes data operations.
mirnawong1 marked this conversation as resolved.
Show resolved Hide resolved
- You can review the exports execution details in the jobs logs. Since saved queries are integrated into the dbt DAG, all outputs related to exports are available in the `dbt build` logs.
- Your data is now available in the data platform for querying.

<Lightbox src="/img/docs/dbt-cloud/semantic-layer/saved_queries_run.jpg" width="90%" title="TeThe st"/>


mirnawong1 marked this conversation as resolved.
Show resolved Hide resolved
## Caching

Caching reduces load times and costs by pre-computing and storing frequently queried datasets. This feature is critical for companies with large datasets or requiring fast query compute times.

There are two types of caching:
- Result cache &mdash; Cache all queries in the data platform and configured at the project or environment-level. This cache is used to store the results of a query save costs, and speed up subsequent queries.
- Declarative cache &mdash; Saved queries specified by the user and defaults to all saved queries being cached or not. This cache enables more control over what is cached.

To configure caching, you can add the `config` property to your `saved_queries` configuration:

```yaml
saved_queries:
- name: my_query
description:
query_params:
...
exports:
...
config:
cache:
enabled: true|false
```

### Parameters

| GraphQL | dbt Cloud CLI | ADBC| Description |
mirnawong1 marked this conversation as resolved.
Show resolved Hide resolved
| --- | --- | --- | --- |
| `create-query` | `dbt sl query` | `{{ semantic_layer.query() }}` | Allows you to build the SQL for a query that does not hit the cache, utilizes a saved-query to specify parameters or specifies whether the cache should be utilized or overwritten.
| `drop-cache` | `dbt sl cache drop` | `{{ semantic_layer.drop_cache() }}` | Drops datasets from the cache using parameters which target specific object |
| `inspect-cache` | `dbt sl cache inspect` | `{{ semantic_layer.inspect_cache() }}` | Inspect and provides a list of objects that are in the cache. |

## Job commands?

Additional parameters and commands are introduced in MetricFlow CLI and Cloud Interfaces to support Saved Queries and Exports functionalities.

| GraphQL | dbt Cloud CLI | ADBC | Description |
| --- | --- | --- | --- |
| `create-query` | `dbt sl query` | `{{ semantic_layer.query() }}` | Allows you to build the SQL for a query that does not hit the cache, utilizes a saved-query to specify parameters or specifies whether the cache should be utilized or overwritten |
| `export` | `dbt sl export` | None, Not possible | Builds an export using the GraphQL API. Use the export [parameters](#parameters). specified above in |


## FAQs
mirnawong1 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ The following table compares the features available in dbt Cloud and source avai
| Query dimension, entity, and metric metadata through the CLI | ✅ | ✅ |
| Query metrics and dimensions through semantic APIs (ADBC, GQL) | ❌ | ✅ |
| Connect to downstream integrations (Tableau, Hex, Mode, Google Sheets, and so on.) | ❌ | ✅ |
| Create and run Exports to save metrics queries as tables in your data platform. | ❌ | Coming soon |
| Create and run Exports to save metrics queries as tables in your data platform. | ❌ | |

## FAQs

Expand Down
1 change: 1 addition & 0 deletions website/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,7 @@ const sidebarSettings = {
"docs/use-dbt-semantic-layer/dbt-sl",
"docs/use-dbt-semantic-layer/quickstart-sl",
"docs/use-dbt-semantic-layer/setup-sl",
"docs/use-dbt-semantic-layer/exports",
"docs/use-dbt-semantic-layer/sl-architecture",
{
type: "category",
Expand Down
mirnawong1 marked this conversation as resolved.
Show resolved Hide resolved
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading