ReOrc docs
Get ReOrc
简体中文
简体中文
  • 欢迎使用 Reorc
  • 设置与部署
    • 设置组织
    • 安装 Reorc-agent
  • 快速开始
    • 1. 添加连接源
    • 2. 创建项目
    • 3. 创建数据模型
    • 4. 验证数据处理流程
    • 5. 创建数据管道和调度任务
  • 连接
    • 目标数据库
    • 项目连接管理
  • 数据建模
    • 概述
    • 数据源
    • 模型
      • 宏
      • 物化
      • 模型配置
    • 字段列表
    • 数据血缘
    • 数据库特定配置
      • SelectDB(Doris)
  • 语义层建模
    • 概述
    • 语义层模型 (Cube)
      • 自定义维度
      • 自定义指标
        • 聚合计算函数
    • 语义层视图 (View)
    • 模型关系 (Relationship)
    • BI 接入方式
  • 数据摄入
    • 概述
    • 连接源类型
      • 从数据库获取数据
      • MySQL
      • SelectDB(Doris)
    • 数据转换(Transform)
  • 数据管道
    • 概述
    • 建模管道
    • 任务调度
  • 进阶用法
    • Jinja 模板
    • 变量
      • 系统内置变量
      • 项目内自定义变量
  • 健康监测
    • 数据管道健康
  • 资产管理
    • 元数据
    • 版本历史
    • dbt 包和项目依赖
  • 数据服务
    • 概述
    • 创建和编辑
    • 数据预览和下载
    • 权限管理
    • 开放 API
  • 数据安全
    • 数据脱敏
  • 设置
    • 组织设置
    • 项目设置
    • 个人设置
    • 角色和权限设置
Powered by GitBook
On this page
  • SelectDB(Doris) 配置项
  • 增量模型
  • 最佳实践
  1. 数据建模
  2. 数据库特定配置

SelectDB(Doris)

Previous数据库特定配置Next概述

Last updated 4 months ago

SelectDB(Doris) 配置项

config 语法格式:

{{ config(
    materialized = "table",
    duplicate_key = [ "<column-name>", ... ],
    partition_by = [ "<column-name>", ... ],
    partition_type = "<engine-type>",
    partition_by_init = ["<pertition-init>", ... ]
    distributed_by = [ "<column-name>", ... ],
    buckets = "int",
    properties = {"<key>":"<value>",...}
      ...
    ]
) }}

在 Doris/SelectDB 上建模时,可使用的配置项如下:

配置项
描述
Required or not?

materialized

How the model will be materialized into Doris. Must be table to create a table model.

Required, can be defined in metadata

duplicate_key

The key list of Doris table model: 'duplicate'.

Required

partition_by

The partition key list of Doris.

Optional

partition_type

The partition type of Doris.

Optional (default: RANGE)

partition_by_init

The partition rule or some real partitions item.

Optional

distributed_by

The bucket key list of Doris.

Required

buckets

The bucket number in one Doris partition.

Required

properties

The other configuration of Doris.

Required

增量模型

An incremental Doris table, item table model must be 'unique' and is configured using the following syntax:

{{ config(
    materialized = "incremental",
    unique_key = [ "<column-name>", ... ],
    partition_by = [ "<column-name>", ... ],
    partition_type = "<engine-type>",
    partition_by_init = ["<pertition-init>", ... ]
    distributed_by = [ "<column-name>", ... ],
    buckets = "int",
    properties = {"<key>":"<value>",...}
      ...
    ]
) }}

Available configurations:

Option
Description
Required or not?

materialized

How the model will be materialized into Doris. Must be table to create a table model.

Required

unique_key

Required

partition_by

Optional

partition_type

The partition type of Doris.

Optional (default: RANGE)

partition_by_init

The partition rule or some real partitions item.

Optional

distributed_by

Required

buckets

The bucket number in one Doris partition.

Required

properties

Required

最佳实践

Here's a sample model using Doris for incrementally update by partition:

{{ 
  config(
    materialized = "incremental",
    unique_key = ["id"],  -- Specify the unique key for the incremental model
    partition_by = ["date"],  -- Partition by the date column
    partition_type = "RANGE",  -- Specify the partition type (e.g., RANGE, HASH)
    partition_by_init = ["2025-01-01"],  -- Initial partition value
    distributed_by = ["id"],  -- Distribute by the id column
    buckets = 10,  -- Number of buckets for distribution
    properties = {
      "compression": "lz4",  -- Example property for compression
      "replication_factor": "2"  -- Example property for replication factor
    }
  ) 
}}

SELECT
    id AS order_id,
    DATE(ordered_at) AS date,
    order_total,
    ordered_at,
    NOW() AS updated_at
FROM
    {{ source('ecom', 'raw_orders') }}
    
{% if is_incremental() %}
WHERE
    DATE(ordered_at) = '{{ var("dt") }}'  -- Process only current date's data
{% endif %}

Incremental table configuration

The key list of Doris table model :''.

The partition key list of Doris. ()

The bucket key list of Doris. ()

The other configuration of Doris. ()

查看更多用法,可参考

​
​
Doris 官方文档
Doris unique
Doris partition
Doris distribute
Doris properties