3.2.3. 创建维度表

维度表将使用 Products 和 Customers。每个 Product 会关联一些 product line(产品线),产品线就是产品的种类,比如 Ford T 属于 Vintage Cars 产品线。

Customers 属于特定的城市,这些城市属于某些国家,国家又按照洲分布。

  1. 首先,创建 Product 变换。拖拽 Table input 节点到工作簿(worksheet)并且定义报表需要的字段:product id, nameproduct_line_id

    star schema 2
    Figure 3. Product 表输入
  2. 然后创建 products 的插入/更新节点:

    star schema 3
    Figure 4. 插入/更新 Product
  3. 创建 product lines 变换:

    star schema 4
    Figure 5. Product 变换
  4. 通过 Update 节点完成第一个变换:

    star schema 5
    Figure 6. 更新 Product
  5. 按照相同的方式创建 Customer 变换,包含城市和洲级别。然后添加到第一个 Product 中:

    star schema 6
    Figure 7. Customer 变换
  6. 当变换准备好之后,再套上外围相应的任务,START - 启动Success - 成功,以及 Abort job 节点用来做出错时退出:

    star schema 12
    Figure 8. 维度任务