Pentaho 维数 "=10="

Pentaho Dimension lookup/update

我看过 Dimension Lookup/Update documentation here 和其他一些博客。但我似乎无法清楚地知道。 我有一个具有以下结构的 table:

 Key Name Code Status IN Out Active

key name code status active 来自 csv 文件。 我需要对 scd type2 使用 Dimension lookup/update 步骤并填充 IN/Out

设置连接详细信息后, 我已将键设置为 KEY,将字段设置为选项 Date of last insert (without stream field as source) 的所有其他字段。如果任何其他字段发生变化,我需要在数据库中创建一个新行。该行将具有相同的 key 和更新的详细信息,其中 out 设置为无穷大并且 in 设置为当前系统日期。

日期范围开始字段设置为 IN,Table 日期范围结束字段设置为数据库的 OUT 列。

我不明白这个技术密钥的概念,因为密钥也来自 csv 文件。

当我点击预览时出现错误:

   DB2 SQL error: SQLCODE: -407, SQLSTATE: 23502, SQLERRMC: 

请让我知道更多详细信息以及我一定错过的任何步骤或设置。

构建SCD II.Dimension Lookup / Update步骤(在更新模式中使用)的要点 SCD II. table 是:

  • Keys - Key fields: 在这里,您根据源数据定义了一个 id 列(我猜它是来自 CSV 文件的 Key )。它用于查找以前存储的具有相同 Key 的行,因此该步骤可以将传入行与已存储在 SCD II 中的行进行比较。并评估该行是否已更改。
  • 技术关键字段:技术关键是您需要添加到 table 的额外新列(例如 technical_key)。在您的 PDI 记录流中也是新的(与您的 table technical_key 中的名称相同)。将其设置为 auto increment。当向 table 中插入任何新行时,它会自动递增,并且它的值在 table 中是唯一的(因此可以用作 table 的主键)。
  • Stream Datefield: 通常,您在此处放置源数据中的 last_updated_date 列,每次在源数据中更新行记录时,它会将其值更改为实际日期。或者您可以使用执行转换时的实际时间(从 Get System Info.system date 步骤获得)。
  • 日期范围开始字段,Table 日期范围和: SCD II 中的每一行。 table需要有有效期(行数据范围内有效)。此期间由两个日期定义 - 开始日期 (Date range start field) 和结束日期 (Table date range end)。您将这两个字段设置为 INOut(table 列的名称)。该步骤将使用“Range start, end”和Stream Datefield值自动确定它们的值(设置Min. year = 1900Max. year = 2199):

    • 当行(由 Key 标识)是新行时:
      • Key = 1; technical_key = 123; In = 1900-01-01; Out = 2199-12-31; Name = X
    • 例如明天。同一行已更新(Stream Datefield 的值 = '2015-03-13'):
      • Key = 1; technical_key = 123; In = 1900-01-01; Out = 2015-03-13; Name = X
      • Key = 1; technical_key = 158; In = 2015-03-13; Out = 2199-12-31; Name = A
  • Fields - 更新字段: 在这里定义所有要存储的数据字段:Name Code Status Active。作为 Type of dimension updateInsert(用于 SCD II. 属性)。

    • 无法使用 Date of last insert (without stream field as source),因为它只是将实际日期时间简单地写出到特定的 dimension field 并且您不能定义 stream field 以及此选项。
    • 当您对属性的历史(SCD I.)不感兴趣时​​,可以使用 Punch through 选项。它用相同的 Key 覆盖行中所有出现的地方。例如。 Punch throughName 上(新值 'A'):
      • Key = 1; technical_key = 123; In = 1900-01-01; Out = 2015-03-13; Name = A
      • Key = 1; technical_key = 158; In = 2015-03-13; Out = 2199-12-31; Name = A