Skip to content

Commit

Permalink
Merge branch 'current' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
mirnawong1 authored Feb 7, 2024
2 parents 0a36907 + 84446d6 commit dbdb7db
Show file tree
Hide file tree
Showing 6 changed files with 96 additions and 8 deletions.
2 changes: 1 addition & 1 deletion website/docs/docs/community-adapters.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ Community adapters are adapter plugins contributed and maintained by members of
| [TiDB](/docs/core/connect-data-platform/tidb-setup) | [Firebolt](/docs/core/connect-data-platform/firebolt-setup) | [MindsDB](/docs/core/connect-data-platform/mindsdb-setup)
| [Vertica](/docs/core/connect-data-platform/vertica-setup) | [AWS Glue](/docs/core/connect-data-platform/glue-setup) | [MySQL](/docs/core/connect-data-platform/mysql-setup) |
| [Upsolver](/docs/core/connect-data-platform/upsolver-setup) | [Databend Cloud](/docs/core/connect-data-platform/databend-setup) | [fal - Python models](/docs/core/connect-data-platform/fal-setup) |
| [TimescaleDB](https://dbt-timescaledb.debruyn.dev/) | [Extrica](/docs/core/connect-data-platform/extrica-setup) | |
| [TimescaleDB](https://dbt-timescaledb.debruyn.dev/) | [Extrica](/docs/core/connect-data-platform/extrica-setup) | [RisingWave](/docs/core/connect-data-platform/risingwave-setup) |
87 changes: 87 additions & 0 deletions website/docs/docs/core/connect-data-platform/risingwave-setup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
---
title: "RisingWave setup"
id: "risingwave-setup"
description: "Read this guide to learn about how to set up RisingWave in dbt."
meta:
maintained_by: RisingWave
pypi_package: 'dbt-risingwave'
authors: 'Dylan Chen'
github_repo: 'risingwavelabs/dbt-risingwave'
min_core_version: 'v1.6.1'
min_supported_version: ''
cloud_support: Not Supported
slack_channel_name: 'N/A'
slack_channel_link: 'https://www.risingwave.com/slack'
platform_name: 'RisingWave'
config_page: '/reference/resource-configs/no-configs'
---

:::info Vendor-supported plugin

Certain core functionality may vary. If you would like to report a bug, request a feature, or contribute, you can check out the linked repository and open an issue.

:::

import SetUpPages from '/snippets/_setup-pages-intro.md';

<SetUpPages meta={frontMatter.meta} />

## Connecting to RisingWave with dbt-risingwave

Before connecting to RisingWave, ensure that RisingWave is installed and running. For more information about how to get RisingWave up and running, see the [RisingWave quick start guide](https://docs.risingwave.com/docs/dev/get-started/).

To connect to RisingWave with dbt, you need to add a RisingWave profile to your dbt profile file (`~/.dbt/profiles.yml`). Below is an example RisingWave profile. Revise the field values when necessary.

<File name='~/.dbt/profiles.yml'>

```yaml
default:
outputs:
dev:
type: risingwave
host: [host name]
user: [user name]
pass: [password]
dbname: [database name]
port: [port]
schema: [dbt schema]
target: dev
```
</File>
|Field|Description|
|---|---|
|`host`| The host name or IP address of the RisingWave instance|
|`user`|The RisingWave database user you want to use|
|`pass`| The password of the database user|
|`dbname` | The RisingWave database name|
|`port` | The port number that RisingWave listens on|
|`schema`| The schema of the RisingWave database|

To test the connection to RisingWave, run:

```bash
dbt debug
```

## Materializations

The dbt models for managing data transformations in RisingWave are similar to typical dbt SQL models. In the `dbt-risingwave` adapter, we have customized some of the materializations to align with the streaming data processing model of RisingWave.

|Materializations| Supported|Notes|
|----|----|----|
|`table` |Yes |Creates a [table](https://docs.risingwave.com/docs/dev/sql-create-table/). To use this materialization, add `{{ config(materialized='table') }}` to your model SQL files. |
|`view`|Yes | Creates a [view](https://docs.risingwave.com/docs/dev/sql-create-view/). To use this materialization, add `{{ config(materialized='view') }}` to your model SQL files. |
|`ephemeral`|Yes| This materialization uses [common table expressions](https://docs.risingwave.com/docs/dev/query-syntax-with-clause/) in RisingWave under the hood. To use this materialization, add `{{ config(materialized='ephemeral') }}` to your model SQL files.|
|`materializedview`| To be deprecated. |It is available only for backward compatibility purposes (for v1.5.1 of the dbt-risingwave adapter plugin). If you are using v1.6.0 and later versions of the dbt-risingwave adapter plugin, use `materialized_view` instead.|
|`materialized_view`| Yes| Creates a [materialized view](https://docs.risingwave.com/docs/dev/sql-create-mv/). This materialization corresponds the `incremental` one in dbt. To use this materialization, add `{{ config(materialized='materialized_view') }}` to your model SQL files.|
| `incremental`|No|Please use `materialized_view` instead. Since RisingWave is designed to use materialized view to manage data transformation in an incremental way, you can just use the `materialized_view` materialization.|
|`source`| Yes| Creates a [source](https://docs.risingwave.com/docs/dev/sql-create-source/). To use this materialization, add {{ config(materialized='source') }} to your model SQL files. You need to provide your create source statement as a whole in this model. See [Example model files](https://docs.risingwave.com/docs/dev/use-dbt/#example-model-files) for details.|
|`table_with_connector`| Yes| Creates a table with connector settings. In RisingWave, a table with connector settings is similar to a source. The difference is that a table object with connector settings persists raw streaming data in the source, while a source object does not. To use this materialization, add `{{ config(materialized='table_with_connector') }}` to your model SQL files. You need to provide your create table with connector statement as a whole in this model (see [Example model files](https://docs.risingwave.com/docs/dev/use-dbt/#example-model-files) for details). Because dbt tables have their own semantics, RisingWave use `table_with_connector` to distinguish itself from a dbt table.|
|`sink`| Yes| Creates a [sink](https://docs.risingwave.com/docs/dev/sql-create-sink/). To use this materialization, add `{{ config(materialized='sink') }}` to your SQL files. You need to provide your create sink statement as a whole in this model. See [Example model files](https://docs.risingwave.com/docs/dev/use-dbt/#example-model-files) for details.|

## Resources

- [RisingWave's guide about using dbt for data transformations](https://docs.risingwave.com/docs/dev/use-dbt/)
- [A demo project using dbt to manage Nexmark benchmark queries in RisingWave](https://docs.risingwave.com/docs/dev/use-dbt/)
2 changes: 1 addition & 1 deletion website/docs/docs/deploy/job-notifications.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ You can receive email alerts about jobs by configuring the dbt Cloud email notif
You can receive Slack alerts about jobs by setting up the Slack integration, then configuring the dbt Cloud Slack notification settings.

:::note
Any account admin can edit the Slack notifications but they'll be limited to configuring the channels that their Slack user has access to. If there has been a change in user roles or Slack permissions where you no longer have access to edit a configured Slack channel, please [contact support](mailto:[email protected]) for assistance.
If there has been a change in user roles or Slack permissions where you no longer have access to edit a configured Slack channel, please [contact support](mailto:[email protected]) for assistance.
:::

### Prerequisites
Expand Down
8 changes: 4 additions & 4 deletions website/docs/reference/node-selection/graph-operators.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ title: "Graph operators"
---

### The "plus" operator
If placed at the front of the model selector, `+` will select all parents of the selected model. If placed at the end of the string, `+` will select all children of the selected model.
If placed at the front of the model selector, `+` will select all parents of the selected model and the model itself. If placed at the end of the string, `+` will select all children of the selected model and the model itself.


```bash
dbt run --select "my_model+" # select my_model and all children
dbt run --select "+my_model" # select my_model and all parents
dbt run --select "+my_model+" # select my_model, and all of its parents and children
dbt run --select "+my_model+" # select my_model, and all of its parents and children
```


Expand All @@ -22,7 +22,7 @@ to step through.
```bash
dbt run --select "my_model+1" # select my_model and its first-degree children
dbt run --select "2+my_model" # select my_model, its first-degree parents, and its second-degree parents ("grandparents")
dbt run --select "3+my_model+4" # select my_model, its parents up to the 3rd degree, and its children down to the 4th degree
dbt run --select "3+my_model+4" # select my_model, its parents up to the 3rd degree, and its children down to the 4th degree
```


Expand All @@ -32,5 +32,5 @@ The `@` operator is similar to `+`, but will also include _the parents of the ch
<Lightbox src="/img/docs/running-a-dbt-project/command-line-interface/1643e30-Screen_Shot_2019-03-11_at_7.18.20_PM.png" title="@snowplow_web_page_context will select all of the models shown here"/>

```bash
dbt run --models @my_model # select my_model, its children, and the parents of its children
dbt run --models @my_model # select my_model, its children, and the parents of its children
```
1 change: 1 addition & 0 deletions website/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ const sidebarSettings = {
"docs/core/connect-data-platform/upsolver-setup",
"docs/core/connect-data-platform/starrocks-setup",
"docs/core/connect-data-platform/extrica-setup",
"docs/core/connect-data-platform/risingwave-setup",
],
},
],
Expand Down
4 changes: 2 additions & 2 deletions website/snippets/quickstarts/change-way-model-materialized.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ By default, everything gets created as a view. You can override that at the dire
models:
jaffle_shop:
+materialized: table
example:
+materialized: view
example:
+materialized: view
```

</File>
Expand Down

0 comments on commit dbdb7db

Please sign in to comment.