1

我正在设计一个数据仓库,我需要一个可以生成日期维度的工具。我正在使用 MySQL 5.x。

谢谢

4

2 回答 2

2

您没有指定是使用第三方 ETL 应用程序还是滚动您自己的应用程序。

如果您使用的是第三方应用程序,则很可能会有一个小部件或功能可用于帮助生成您的日期维度。例如,使用 Pentaho 数据集成工具包,请参阅 O'Reilly 数据库博客中的这篇优秀文章:http ://www.oreillynet.com/databases/blog/2007/09/kettle_tip_using_java_locales.html

如果您自己滚动,生成两个给定日期之间的每个日期是一个非常简单的练习。存储过程将具有更高的性能,但用您正在实现 ETL 的语言编写函数将更易于维护。@hafichuk 发布的有用链接是如何在存储过程中进行生成的好例子。由于您正在设计模式,因此您必须编写符合您对日期维度的定义的自己的过程,或者至少修改那些。

最后,请确保在您选择的解决方案中为自己提供灵活性 - 即使每个“世界”的生产实例构建只会生成一次日期,但在很多其他时候需要相同的日期维度生成代码要使用的。(测试运行、演示/暂存部署、集成测试套件......)因此,它需要足够快和/或足够灵活,以免成为瓶颈。在 ETL 语言中生成日期维度并在每个适用日期范围的集成测试开始时这样做会变得过时、快速。

于 2011-12-05T23:47:52.643 回答
1

You should definitely check out this free date dimension feed on the Azure Data Market.

It's a date table feed designed for import into an Excel PowerPivot model, but can easily be used for other destinations as well (for example like a MySQL table).

The table contains columns particularly suitable for time business intelligence applications, and contains generic English language columns helping with creating a basic, all-purpose date dimension.

It also contains several other languages (including US, Hebrew, Danish, German and Bulgarian, and other languages are on the way).

于 2011-12-14T12:32:22.040 回答