데이터 기반 모듈 생성
맞춤 데이터 파운데이션 모듈은 맞춤 빌드 동작을 정의하거나 기본적으로 지원되지 않는 새 소스 시스템 (예: 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:
# Recommended naming for foundation_module_id:
# custom_namespace_data_foundation_module_type
- moduleId: foundation_module_id
type: cortex.sap
dataSourceId: sap_raw_s4
dataTargetId: data_foundation_sap_custom_namespace
moduleSettings:
sapVersion: s4
mandt: "100"
# Custom table settings file, relative to 'config/' directory
# If omitted, defaults to "../src/data_modules/custom_namespace/data_foundation/data_foundation_module_type/table_settings.default.yaml"
# tableSettings: "custom_namespace/data_foundation/data_foundation_module_type/table_settings.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"
# Custom table settings file, relative to 'config/' directory
# If omitted, defaults to "../src/data_modules/custom_namespace/data_foundation/data_foundation_module_type/table_settings.default.yaml"
# tableSettings: "custom_namespace/data_foundation/data_foundation_module_type/table_settings.yaml"
- 구성에서 참조된
tableSettings파일을 만들어 원시 레이어 데이터 세트의 어떤 테이블이 데이터 기반 레이어로 변환될지 정의합니다. 기본 경로인src/data_modules/custom_namespace/data_foundation/data_foundation_module_type/table_settings.default.yaml을 사용하는 것이 좋습니다.
common:
- source:
tableName: custom_sap_table_name
target:
tags: [sap, s4, hourly]
clusterDetails:
columns: [ pk_column]
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_bookingdatamodel
moduleSettings:
sapVersion: s4
mandt: "100"
table_settings.default.yaml 만들기
표 설정 파일을 만듭니다. src/data_modules/sap_bookingdatamodel/data_foundation/sap/table_settings.default.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"
맞춤 데이터 기반 모듈이 성공적으로 컴파일되고 배포되었는지 확인하려면 데이터 제품 확장성 페이지의 확인 섹션을 참고하세요.
- 이전 단계: 커스텀 네임스페이스 설정
- 다음 단계: 데이터 제품 모듈 생성
- 개요로 돌아가기