DBT 项目建立

ARTS第三周 T

dbt Developer Hub (getdbt.com)

安装

pip install dbt-core dbt-clickhouse

注意一些依赖: redhat-rpm-config gcc libffi-devel  python3-devel openssl-devel

还有backports.datetime_fromisoformat 安装时报:

backports/datetime_fromisoformat/_datetimemodule.c: 在函数‘_sanitize_isoformat_str’中:
backports/datetime_fromisoformat/_datetimemodule.c:776:5: 错误:只允许在 C99 模式下使用‘for’循环初始化声明
     for(size_t idx = 0;
     ^

类似这个issue:

Installing backports-datetime-fromisoformat on Python 2 doesn't work · Issue #14 · movermeyer/backports.datetime_fromisoformat · GitHub

解决步骤:通过源码编译:python setup.py install

前提是在setup.py里把os.versiron配置了:os.environ

os.environ["CFLAGS"] = " -Werror "
os.environ["CFLAGS"] += " -std=c99"

记得注意虚拟环境的问题。

初始化DBT构建项目

dbt init dbt_project

reating dbt configuration folder at /root/.dbt

Your new dbt project "dbt_ch_project" was created! If this is your first time
using dbt, you'll need to set up your profiles.yml file -- this file will tell dbt how
to connect to your database. You can find this file by running:

  xdg-open /root/.dbt

For more information on how to configure the profiles.yml file,
please consult the dbt documentation here:

  https://docs.getdbt.com/docs/configure-your-profile

One more thing:

Need help? Don't hesitate to reach out to us via GitHub issues or on Slack:

  https://community.getdbt.com/

Happy modeling!

创建profile.yml, 配置dbt_project.yml

Connection profiles | dbt Developer Hub (getdbt.com)

然后dbt debug检查是否正确。

dbt run执行数据模型。

dbt docs generate 生成文档。

dbt docs serve 在线文档


 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值