dremio dbt 实现简单说明

dremio dbt adapter 是一个方便的可以通过dbt 进行dremio 模型的工程化建模工具,adapter 实现上也是按照标准的套路
以下是一个关于实现的简单说明

内部实现特点

  • dremio 的操作基于了http 的rest api,没有使用odbc 或者flight sql 处理,这样dbt 包相对简单轻量一些,毕竟dbt dremio 核心是执行查询并没有太多复杂的数据处理
  • 内部按照官方的标准,重写了不少macro,比如ref,source (builtins macros)
  • 对于物化实现,包含了table(ctas),view (标准create view ),reflection (默认关闭)
  • 对于增量的更新比较简单,目前主要是append 模式的,其他模式暂时没提供

connection 参考类图

说明

目前dremio dbt 实现功能点还是比较全的,可以结合源码学习下也可以方便问题排错以及后续的改进

参考资料

https://docs.getdbt.com/guides/adapter-creation?step=1
https://github.com/dremio/dbt-dremio
https://docs.getdbt.com/guides/create-new-materializations?step=2
https://docs.getdbt.com/reference/dbt-jinja-functions/config
https://docs.getdbt.com/reference/resource-configs/pre-hook-post-hook
https://docs.getdbt.com/reference/dbt-jinja-functions/builtins
https://github.com/dbt-labs/dbt-common
https://github.com/dremio/dbt-dremio/blob/main/dbt/include/dremio/macros/adapters/columns.sql
https://github.com/dremio/dbt-dremio/blob/main/dbt/include/dremio/dbt_project.yml

posted on 2024-04-03 00:46  荣锋亮  阅读(12)  评论(0编辑  收藏  举报

导航