Skip to main content

The RisingWave adapter plugin for dbt

Project description

dbt-risingwave

A RisingWave adapter plugin for dbt.

RisingWave is a cloud-native streaming database that uses SQL as the interface language. It is designed to reduce the complexity and cost of building real-time applications. https://www.risingwave.com

dbt enables data analysts and engineers to transform their data using the same practices that software engineers use to build applications. Use dbt for data transformations in RisingWave

Getting started

The package has not been published to PyPI, please install it via git.

  1. Install dbt-risingwave
python3 -m pip install dbt-risingwave
  1. Get RisingWave running

Please follow this guide to set up a functional RisingWave instance.

  1. Configure the dbt profile file

The profile file is located in ~/.dbt/profiles.yml. Here's an example of how to use it with RisingWave.

default:
  outputs:
    dev:
      type: risingwave
      host: 127.0.0.1
      user: root
      pass: ""
      dbname: dev
      port: 4566
      schema: public
  target: dev
  1. Run dbt debug to check whether the configuration is correct.

Models

The dbt models for managing data transformations in RisingWave are similar to typical dbt sql models. The main differences are the materializations. We customized the materializations to fit the data processing model of RisingWave.

Materializations INFO
materialized_view Create a materialized view. This materialization corresponds to the incremental one in dbt. To use this materialization, add {{ config(materialized='materialized_view') }} to your model SQL files.
materializedview (Deprecated) only for backward compatibility, use materialized_view instead
ephemeral This materialization uses common table expressions in RisingWave under the hood. To use this materialization, add {{ config(materialized='ephemeral') }} to your model SQL files.
table Create a table. To use this materialization, add {{ config(materialized='table') }} to your model SQL files.
view Create a view. To use this materialization, add {{ config(materialized='view') }} to your model SQL files.
incremental Use materialized_view instead if possible, since RisingWave is designed to use a materialized view to manage data transformation in an incremental way. From v1.7.3, dbt-risingwave supports incremental model to give users better control of when to update their model. This model will update the table in a batch way incrementally.
source Define a source {{ config(materialized='source') }}. You need to provide your create source statement as a whole in this model.
table_with_connector Define a table with a connector {{ config(materialized='table_with_connector') }}. You need to provide your create table with connector statement as a whole in this model. Because dbt table has its own semantics, RisingWave uses table_with_connector to distinguish itself from it. The connector is optional if you just want to define a table without anything connector.
sink Define a sink {{ config(materialized='sink') }}. You need to provide your create sink statement as a whole in this model.

To learn how to use, you can check RisingWave's official example dbt_rw_nexmark.

DBT RUN behavior

  • dbt run: only create new models (if not exists) without dropping any models.
  • dbt run --full-refresh: drop models and create the new ones. This command can make sure your streaming pipelines are consistent with what you define in dbt models.

Graph operators

Graph operators is useful when you want to only recreate a subset of your models.

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

Tests

All items below have been tested against the latest RisingWave daily build version.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dbt_risingwave-1.9.2.tar.gz (18.5 kB view details)

Uploaded Source

Built Distribution

dbt_risingwave-1.9.2-py3-none-any.whl (22.4 kB view details)

Uploaded Python 3

File details

Details for the file dbt_risingwave-1.9.2.tar.gz.

File metadata

  • Download URL: dbt_risingwave-1.9.2.tar.gz
  • Upload date:
  • Size: 18.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.12

File hashes

Hashes for dbt_risingwave-1.9.2.tar.gz
Algorithm Hash digest
SHA256 a7359acb8c6859c8f744996e9c69e44e5f8b01ec507269bee7973ac4bcc71b9a
MD5 95375b7c410b9e280e4ffc22c828e443
BLAKE2b-256 4ad4905ff587ed21c003e218b6fd370c052161f0142799857479d2cba474b825

See more details on using hashes here.

File details

Details for the file dbt_risingwave-1.9.2-py3-none-any.whl.

File metadata

  • Download URL: dbt_risingwave-1.9.2-py3-none-any.whl
  • Upload date:
  • Size: 22.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.12

File hashes

Hashes for dbt_risingwave-1.9.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e8edfe57c7b12bb5290c6aa6156f2b6a85e6b4b7e1ab4b81528d3db9b9007ec4
MD5 dbd6af7dadd02d16dd1cb79aef1ed35c
BLAKE2b-256 d425e68d18d4b78f8a7c6b52afe296849799a6021d6cb64d5b46a62db6af9037

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page