如何在Kimball式数据仓库中对这种关系进行维度建模? [英] How do I dimensionally model this relationship in a Kimball-style data warehouse?

查看:103
本文介绍了如何在Kimball式数据仓库中对这种关系进行维度建模?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我在数据仓库中有两个维度:

So I have two dimensions in my data warehouse:

dim_machine
-------------
machine_key
machine_name
machine_type


dim_tool
------------
tool_key
tool_name
machine_type

我要确保的是两个维度中的machine_type字段具有相同的数据。我应该在雪花与雪花之间创建第三个维度吗?

What I want to make sure of is the machine_type field in both dimensions has the same data. Should I create a third dimension to snowflake between the two or is there another alternative?

推荐答案

我不确定到底是什么问题你想解决?这听起来像是您可以简单地构建到ETL流程中的东西:对于两个维度,都将源数据映射到相同的机器类型目标列表。如果出现没有映射的新值,请引发错误(或设置默认的占位符值,然后再查看数据)。

I'm not sure exactly what problem you're trying to solve? This sounds like something that you would simply build into the ETL process: for both dimensions, map your source data to the same target list of machine types. If a new value appears that has no mapping, raise an error (or set a default placeholder value and review the data later).

一个完全不同的选项是微型尺寸(Kimball的术语),包含所有可能的机器/工具组合。如果两个维度紧密相关并且经常在搜索中一起使用,则这可能是合并和简化它们的有用方法。但是即使那样,我仍然假设您将检查并清理源数据以符合机器类型。

A completely different option would be a "mini-dimension" (Kimball's term), that holds all possible machine/tool combinations. If two dimensions are closely related and often used together in searches then it can be useful way to consolidate and simplify them. But even then, I assume you will be checking and cleaning the source data to conform the machine types.

这篇关于如何在Kimball式数据仓库中对这种关系进行维度建模?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆