DBT重复检查忽略模式
在dbt编译
中,有一个模型重复检查,以确保模型不会彼此踩到。这张检查使我有问题。
我们的体系结构
我们的系统描述了处理到不同模式的阶段,我们希望开始使用DBT。因此,说我们正在导入一个原始数据集,我们正在调用jaffles
,我们将拥有一个raw.jaffles
表,clean> clean.jaffles
表格,依此类推。注意RAW
和在此示例中清洁
是不同的模式。
问题
这打破了重复检查。无论我如何自定义架构名称或i 呼叫参考,重复检查发生在触摸任何一个之前,请注意我们有两个名为“ jaffles”的型号不同的模式,并引发错误。
可能的解决方案
- 理想情况下,我会自定义它如何解决用于检查重复的路径以包括模式。但是我找不到如何自定义该部分。
- 可能我可以完全跳过此支票,然后自己进行完整性检查。但是我找不到禁用此问题的选项。
- 我看到的唯一可以使用的解决方案是将每个视图重命名为唯一,这将是我们已经建立的一项超级清洁命名约定的很多工作。
During dbt compile
, there is a model duplication check to be sure models aren’t stepping on top of each other. This check is causing me problems.
Our Architecture
Our system delineates the stages of processing into different schemas, and we're wanting begin using dbt. So, say we’re importing a raw dataset we’re calling jaffles
, we’ll have a raw.jaffles
table, a clean.jaffles
table, and so on. Note raw
and clean
in this examples are different schemas.
The Problem
This breaks the duplication check. No matter how I customize the schema names, or how I call ref, the duplication check happens before touching any of that, notices we have two models named “jaffles”, ignores that they wouldn’t actually collide from being in different schemas, and throws an error.
Possible Solutions
- Ideally, I'd customize how it solves for the paths it uses to check duplication to include schema. But I can't find how to customize that part.
- Possibly I could skip this check altogether and do the integrity check myself. But I couldn't find options to disable this.
- The only solution I'm seeing that could work is to rename each of the views to be unique, and this would be a lot of work polluting an otherwise super-clean naming convention we already have established.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如 docs , ,即使它们在不同的文件夹中”。
但是,您可以做的是使用
自定义别名
(请参阅 docs ),您可以在2个或更多不同的模式中重新使用相同的表/查看名称。在您的示例中,您可以拥有两个不同的模型,它们每个模型都分配了一个:但是,文件名仍然需要与另一个不同。
As stated in the docs, "model names need to be unique, even if they are in distinct folders".
What you could do, though, is to use
custom aliases
(see the docs), where you can re-use the same table/view name within 2 or more different schemas. In your example, you could have two different models that have a specific schema assigned each:Nevertheless, the file names still need to be different one from the other.