Skip to main content

The Starrocks adapter plugin for dbt

Project description

dbt-starrocks

PyPI PyPI - Python Version PyPI - Downloads

This project is under development.

The dbt-starrocks package contains all the code enabling dbt to work with StarRocks.

This is an experimental plugin:

  • We have not tested it extensively
  • Requirements at least StarRocks version 2.5.0+
    • version 3.1.x is recommended
    • Previous versions will no longer support

Installation

This plugin can be installed via pip:

$ pip install dbt-starrocks

Supported features

Starrocks <= 2.5 Starrocks 2.5 ~ 3.1 Starrocks >= 3.1 Feature
Table materialization
View materialization
Materialized View materialization
Incremental materialization
Primary Key Model
Sources
Custom data tests
Docs generate
Kafka

Notice

  1. When StarRocks Version < 2.5, Create table as can only set engine='OLAP' and table_type='DUPLICATE'
  2. When StarRocks Version >= 2.5, Create table as support table_type='PRIMARY'
  3. When StarRocks Version < 3.1 distributed_by is must

Profile Configuration

Example entry for profiles.yml:

starrocks:
  target: dev
  outputs:
    dev:
      type: starrocks
      host: localhost
      port: 9030
      schema: analytics
      username: your_starrocks_username
      password: your_starrocks_password
Option Description Required? Example
type The specific adapter to use Required starrocks
host The hostname to connect to Required 192.168.100.28
port The port to use Required 9030
schema Specify the schema (database) to build models into Required analytics
username The username to use to connect to the server Required dbt_admin
password The password to use for authenticating to the server Required correct-horse-battery-staple
version Let Plugin try to go to a compatible starrocks version Optional 3.1.0

Example

dbt seed properties(yml):

Complete configuration:

models:
  materialized: table       // table or view or materialized_view
  engine: 'OLAP'
  keys: ['id', 'name', 'some_date']
  table_type: 'PRIMARY'     // PRIMARY or DUPLICATE or UNIQUE
  distributed_by: ['id']
  buckets: 3                // default 10
  partition_by: ['some_date']
  partition_by_init: ["PARTITION p1 VALUES [('1971-01-01 00:00:00'), ('1991-01-01 00:00:00')),PARTITION p1972 VALUES [('1991-01-01 00:00:00'), ('1999-01-01 00:00:00'))"]
  properties: [{"replication_num":"1", "in_memory": "true"}]

dbt run config:

Example configuration:

{{ config(materialized='view') }}
{{ config(materialized='materialized_view') }}        
{{ config(materialized='table', engine='OLAP', buckets=32, distributed_by=['id']) }}
{{ config(materialized='incremental', table_type='PRIMARY', engine='OLAP', buckets=32, distributed_by=['id']) }}

Test Adapter

consult the project

Contributing

Welcome to contribute for dbt-starrocks. See Contributing Guide for more information.

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-starrocks-1.3.0.tar.gz (16.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dbt_starrocks-1.3.0-py3-none-any.whl (27.8 kB view details)

Uploaded Python 3

File details

Details for the file dbt-starrocks-1.3.0.tar.gz.

File metadata

  • Download URL: dbt-starrocks-1.3.0.tar.gz
  • Upload date:
  • Size: 16.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for dbt-starrocks-1.3.0.tar.gz
Algorithm Hash digest
SHA256 a05092acad4c8aa15f1801f57de63307160aa613f07d0c7635844cb9c140c5fe
MD5 ba8424befedf4e5f0f3b221931d0bafe
BLAKE2b-256 d28ef9d0f1cb1300831dc2bf20a2a8c3a7df2795afc2e032b3a2f05f0e579a6d

See more details on using hashes here.

File details

Details for the file dbt_starrocks-1.3.0-py3-none-any.whl.

File metadata

  • Download URL: dbt_starrocks-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 27.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for dbt_starrocks-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ad6e0d1a83b03c7a7db616d8dc960b42654ed4bcf1fdf0106c8a0165487c800c
MD5 7f049aec75faf8879833b6287b5a43a8
BLAKE2b-256 a51f4f1ec22fa0669acacf360fb2b6f3bb1cb4506dd86979a7cc7d3d86873088

See more details on using hashes here.

Supported by

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