데이터 기반 모듈 만들기
커스텀 데이터 기반 모듈을 만드는 것은 커스텀 빌드 동작을 정의하거나 기본적으로 지원되지 않는 새 소스 시스템 (예: Salesforce)에 대한 지원을 확장해야 하는 경우에만 필요합니다.
시작하기 전에 처리하려는 소스 테이블이 원시 레이어 데이터 세트에 있는지 확인합니다.
SAP 데이터 기반 모듈로 작업할 때는 복제된 DD03L 테이블에 수집하려는 테이블 (커스텀 또는 보조 테이블 포함)에 필요한 메타데이터 레코드가 포함되어 있는지 확인합니다. 자세한 요구사항은 SAP ERP 메타데이터 요구사항을 참고하세요.
커스텀 데이터 기반 모듈 또는 네임스페이스를 만들 때는 Cortex Framework 아티팩트에서 확장 프로그램과 맞춤설정을 분리하여 수명 주기 관리를 개선하기 위해 전용 커스텀 네임스페이스를 사용하는 것이 좋습니다.
새 데이터 기반 모듈 만들기
데이터 기반 모듈을 정의하려면 다음 단계를 따르세요.
config/config.yaml파일에서 대상 데이터 세트 구성을data.targets에 추가합니다. 이렇게 하면 기반 테이블이 배포될 전용 BigQuery 데이터 세트가 준비됩니다.
[...]
data:
[...]
targets:
- id: data_foundation_sap_custom_namespace
# Google Cloud Project ID for the target dataset.
projectId: target_project_id
# BigQuery dataset ID for the target.
datasetId: data_foundation_sap_custom_namespace
- 데이터 기반 모듈을 정의하려면
config/config.yaml파일 내의modules.foundation섹션에 다음을 추가합니다.
[...]
data:
[...]
modules:
foundation:
[...]
- moduleId: foundation_module_id
type: cortex.sap
dataSourceId: sap_raw_s4
dataTargetId: data_foundation_sap_custom_namespace
moduleSettings:
sapVersion: s4
mandt: "100"
tableSettings: "table_settings.yaml"
# Optional. Path to custom table settings configuration relative to this config file, e.g., `config/custom_namespace_path/data_foundation/sap/table_settings.yaml`
# If omitted, defaults to src/data_modules/cortex/data_foundation/sap/table_settings.default.yaml.
- 대안: 외부 처리된 CDC 테이블을 데이터 기반으로 사용하는 경우
config/config.yaml파일 내의modules.foundation섹션을external: true로 조정하고dataTargetId를 삭제합니다.
[...]
data:
[...]
modules:
foundation:
[...]
- moduleId: foundation_module_id
type: cortex.sap
dataSourceId: sap_raw_s4
external: true
moduleSettings:
sapVersion: s4
mandt: "100"
tableSettings: "table_settings.yaml"
# Optional. Path to custom table settings configuration relative to this config file, e.g., `config/custom_namespace_path/data_foundation/sap/table_settings.yaml`
# If omitted, defaults to src/data_modules/cortex/data_foundation/sap/table_settings.default.yaml.
common:
- source:
tableName: custom_sap_table_name
target:
tags: [sap, s4, hourly]
clusterDetails:
columns: [carrid, connid]
partitionDetails:
column: fldate
partitionType: time
timeGrain: day
데이터 기반 모듈 예시
다음 예시에서는 sflight 테이블을 커스텀 네임스페이스 sap_bookingdatamodel로 처리하는 새 커스텀 데이터 기반 모듈을 등록합니다.
새 데이터 기반 모듈 등록
data:
targets:
- id: data_foundation_sap_bookingdatamodel
projectId: target_project_id
datasetId: data_foundation_sap_bookingdatamodel
modules:
foundation:
- moduleId: sap_bookingdatamodel
type: sap_bookingdatamodel.sap
dataSourceId: sap_raw_s4
dataTargetId: data_foundation_sap_sap_bookingdatamodel
moduleSettings:
sapVersion: s4
mandt: "100"
tableSettings: "table_settings.yaml"
table_settings.yaml 만들기
다음 콘텐츠로 테이블 설정 파일: config/sap_bookingdatamodel/data_foundation/sap/table_settings.yaml을 만듭니다.
common:
- source:
tableName: sflight
target:
tags: [sap, s4, hourly]
clusterDetails:
columns: [carrid, connid]
partitionDetails:
column: fldate
partitionType: time
timeGrain: day
테이블의 레이아웃이 SAP ECC 및 S/4HANA 언어에서 동일하므로 common: 섹션의 하위 요소입니다.
메타데이터로 스키마를 보강하는 데 사용되는 각 테이블의 주석 파일을 만듭니다.
샘플 시나리오에서는 다음 콘텐츠로 src/data_modules/sap_bookingdatamodel/data_foundation/sap/annotations/sflight.yaml을 만듭니다.
description: "transparent table FLIGHT, part of the Basis Components Module, BC-DWB-TND (Training and Demo)."
fields:
- name: "mandt"
description: "Client"
- name: "carrid"
description: "Airline Code"
- name: "connid"
description: "Flight Connection Number"
- name: "fldate"
description: "Flight date"
- name: "price"
description: "Airfare"
- name: "currency"
description: "Local currency of airline"
- name: "planetype"
description: "Aircraft Type"
- name: "seatsmax"
description: "Maximum capacity in economy class"
- name: "seatsocc"
description: "Occupied seats in economy class"
- name: "paymentsum"
description: "Total of current bookings"
- name: "seatsmax_b"
description: "Maximum capacity in business class"
- name: "seatsocc_b"
description: "Occupied seats in business class"
- name: "seatsmax_f"
description: "Maximum capacity in first class"
- name: "seatsocc_f"
description: "Occupied seats in first class"
커스텀 데이터 기반 모듈이 컴파일되고 배포되는지 확인하려면 데이터 제품 확장성 페이지의 확인 섹션을 참고하세요.
- 이전 단계: 커스텀 네임스페이스 설정
- 다음 단계: 데이터 제품 모듈 만들기
- 개요로 돌아가기