Cortex Framework v6 兼容性
v6 兼容性内容为 Cortex Framework v7 架构中的 Cortex Framework v6 工作负载提供了一个架构兼容层。这样,您就可以迁移到 Cortex Framework v7,而不会破坏现有的分析资产,例如 Looker 信息中心或 LookML 语义模型。
支持的数据源
该框架为 SAP ECC 和 SAP S/4HANA 数据源提供了 v6 兼容性内容。
工作原理
v6 兼容性内容充当 v7 数据模型与旧版报告资产之间的适配器:
- 架构兼容的视图:完全按照 Cortex Framework (v6) 中的显示方式公开报告视图名称、列和大小写。
- 目标隔离:通过在单独的命名空间 (
cortex_v6_compatibility) 和专用的 BigQuery 目标数据集中部署兼容性视图,将这些视图与核心 Cortex Framework 表隔离开。
部署兼容性内容
如需部署 Cortex Framework v6 兼容性内容,请完成以下步骤:
- 配置专用的 BigQuery 目标数据集。
- 在
config.yaml文件中启用 v6 兼容性模块。 - 运行 Google Cloud Cortex Framework 构建和部署脚本。
- 执行 Dataform 流水线。
专用目标数据集
您必须将 v6 兼容性内容部署到单独的 BigQuery 数据集。这样可以防止命名空间阴影和物理表冲突,因为兼容性内容使用的许多表与 Cortex Framework v7 核心表共享相同的物理名称(例如 cost_centers、profit_centers、billing 和
deliveries)。
如需创建专用的 BigQuery 数据集,请将 cortex_v6_compatibility_target 添加到 config.yaml
文件中:
data:
datasets:
- id: product_target
projectId: YOUR_TARGET_PROJECT_ID
datasetId: prod_sap_dataproducts # Core v7 tables
- id: cortex_v6_compatibility_target
projectId: YOUR_TARGET_PROJECT_ID
datasetId: prod_sap_cortex6 # Compatibility v6 tables
配置 Cortex Framework
如需在 config.yaml 文件中注册并激活兼容性层,您必须完成以下任务:
- 设置专用目标数据集。
- 注册兼容性命名空间。
将以下所有 Cortex Framework v6 兼容性模块的 enabled 属性设置为
true:sap_cortex_v6_compatibility_master_datasap_cortex_v6_compatibility_accounts_payablesap_cortex_v6_compatibility_financesap_cortex_v6_compatibility_inventorysap_cortex_v6_compatibility_purchasingsap_cortex_v6_compatibility_sales
以下示例演示了启用 sap_cortex_v6_compatibility_inventory 所需的配置更改:
data:
datasets:
- id: cortex_v6_compatibility_target
projectId: YOUR_TARGET_PROJECT_ID
datasetId: prod_sap_cortex6
namespaces:
- name: cortex_v6_compatibility
path: ../src/data_modules/cortex_v6_compatibility
modules:
products:
- moduleId: sap_cortex_v6_compatibility_inventory
modulePath: cortex_v6_compatibility.sap.products.inventory
enabled: true # If using configuration file based on config.yaml.example, ensure the `enabled` flag is set to `true`
syncToKc: false
dependencyBindings:
sapModule: erp
sapMasterData: sap_cortex_v6_compatibility_master_data
sapSales: sap_cortex_v6_compatibility_sales
dataTargetId: cortex_v6_compatibility_target
moduleSettings:
targetCurrencies: ['USD']
rateType: 'M'
languages: ['E']
# You must ensure the `enabled` flag is set to `true` for all of the listed dependent modules. In this example:
# `sap_cortex_v6_compatibility_master_data`
# `sap_cortex_v6_compatibility_sales`
运行要求
我们强烈建议您同时启用所有 Cortex Framework v6 兼容性模块。兼容性内容包含跨模块依赖项(例如,结算视图依赖于主数据表,而库存快照视图依赖于日历维度)。同时启用这些模块可以防止 Dataform 中出现依赖项错误。
库存快照
您必须将库存快照表(stock_weekly_snapshots 和 stock_monthly_snapshots)配置为增量表并执行这些表。
在
Cortex Framework v6 中,库存快照会计算库存数量和值的运行累计总数:
- 初始运行:这些表会处理所有移动交易记录,以确定起始库存水平。
- 后续运行:Dataform 仅处理自上次快照执行以来发布的移动记录,并将其添加到上一期的累计总数中。
如果您以完全刷新(非增量)模式运行这些表,它们会在每次运行时从头开始重新计算整个移动历史记录。这种方法效率低下、成本高昂,并且如果源表包含日期缺口,可能会导致累计计算不正确。请将这些表的具体化类型设置为增量(默认配置)。
构建和部署兼容性内容
如需构建和部署兼容性内容,请按照部署和部署后文档中的说明操作。