SnowConvert AI - Teradata - MLOAD¶
Teradata MLOAD파일을 Python으로 변환하기 위한 변환 참조
Teradata MultiLoad 는 Teradata 데이터베이스의 여러 테이블 및 뷰에 대한 빠른 대용량 유지 관리를 위한 명령 기반 유틸리티입니다.
To simulate the MultiLoad functionality for Teradata in Snowflake, MultiLoad files and commands are transformed to Python code, similar to the transformations performed for BTEQ and FastLoad scripts. The generated code uses the Snowflake Python project called snowconvert.helpers which contains the required functions to simulate the MultiLoad statements in Snowflake.
MultiLoad 명령 변환¶
대부분의 MultiLoad 명령 은 Snowflake에서 관련이 없는 것으로 간주되며, 이러한 명령은 설명이 생략되어 있습니다. 아래는 MultiLoad 명령의 요약 목록과 해당 명령이 Snowflake로 변환된 상태입니다.
| Commands | Transformation Status | Note |
|---|---|---|
| ACCEPT | Commented | |
| BEGIN MLOAD | Transformed | The node is commented out since the transformation occurs in other related statements instead. |
| BEGIN DELETE MLOAD | Commented | |
| DATEFORM | Commented | |
| DELETE | Partially transformed | Check known issues. |
| DISPLAY | Commented | |
| DML LABEL | Transformed | |
| END MLOAD | Transformed | Commented out since is not necessary for the transformation of the BEGIN MLOAD. |
| EOC | Commented | |
| FIELD | Transformed | |
| FILLER | Transformed | This command needs to be with a FIELD and LAYOUT command to be converted. |
| IF, ELSE, and ENDIF | Commented | |
| IMPORT | Transformed | |
| INSERT | Transformed | This is taken as a Teradata Statement, so it doesn't appear in this chapter. |
| LAYOUT | Transformed | This command needs to be with a FIELD and FILLER command to be converted. |
| LOGDATA | Commented | |
| LOGMECH | Commented | |
| LOGOFF | Commented | |
| LOGON | Commented | |
| LOGTABLE | Commented | |
| PAUSE ACQUISITION | Commented | |
| RELEASE MLOAD | Commented | |
| ROUTE MESSAGES | Commented | |
| RUN FILE | Commented | |
| SET | Commented | |
| SYSTEM | Commented | |
| TABLE | Commented | |
| UPDATE | Transformed | This is taken as a Teradata Statement, so it doesn't appear in this chapter. |
| VERSION | Commented | |
그러나 몇 가지 예외적인 명령이 있는데, 이 명령이 Snowflake에서 의도한 대로 작동하려면 Python 전용 코드로 변환해야 합니다. 이 섹션을 참조하십시오.
이 설명서와 관련하여 추가 질문이 있는 경우 snowconvert-support@snowflake.com으로 이메일을 보내주세요.
BEGIN MLOAD¶
.BEGIN MLOAD 명령에 대한 변환은 동작을 올바르게 시뮬레이션하려면 .LAYOUT, .FIELD, .FILLER, .DMLLABEL, .IMPORT 명령이 필요한 여러 부분으로 구성된 변환입니다.
이 변환에 대한 자세한 설명은 다음 하위 섹션에서 확인할 수 있습니다.
.LAYOUT, .FIELD 및 .FILLER¶
.LAYOUT, .FIELD, .FILLER 명령에 대한 변환은 이 레이아웃에서 IMPORT 의 향후 함수 호출에 사용될 변수 정의를 생성합니다.
Teradata (MultiLoad)
Snowflake (Python)
.DML LABEL¶
.DML LABEL 명령에 대한 변환은 레이블 정의 뒤에 문을 포함하는 함수를 생성합니다. .DML LABEL 명령 뒤에는 일반적으로 Insert, Update 또는 Delete 가 옵니다.
Teradata (MultiLoad)
Snowflake (Python)
.IMPORT¶
.IMPORT 명령의 변환은 파일에서 임시 테이블로 데이터를 로딩하기 위해 import_file_to_temptable 헬퍼에 대한 호출을 생성합니다. 그러면 원래 가져오기에 사용되는 모든 APPLY 레이블에 대한 호출이 생성됩니다. 마지막으로 INSERT 레이블에 대한 호출은 쿼리 매개 변수로 변환되며 선택적으로 쿼리 조건을 가질 수 있습니다.
Teradata (MultiLoad)
Snowflake (Python)
Large 예제¶
다양한 명령에 대해 위에 표시된 변환이 주어지면 다음 예를 고려하십시오.
이 입력 데이터로:
Teradata (MultiLoad)
쿼리
결과
| ROW | ID | NAME | AGE |
|---|---|---|---|
| 1 | NULL | ohn | 25 |
| 2 | 2 | aria | 29 |
| 3 | 3 | arlos | 31 |
| 4 | 4 | ike | 40 |
| 5 | 5 | aura | 27 |
Snowflake (Python)
쿼리
결과
| ROW | ID | NAME | AGE |
|---|---|---|---|
| 1 | NULL | ohn | 25 |
| 2 | 2 | aria | 29 |
| 3 | 3 | arlos | 31 |
| 4 | 4 | ike | 40 |
| 5 | 5 | aura | 27 |
Known Issues¶
1. 삭제 문은 부분적으로 지원됩니다
DELETE 문은 LAYOUT 정의된 열을 가리키는 경우 where 조건이 발견되면 올바르게 변환되지 않으므로 부분적으로 지원됩니다.
In the example below, :EmpNo is pointing to a LAYOUT defined column. However, the transformation does not take this into account and thus the code will be referencing a column that does not exist.
이 설명서와 관련하여 추가 질문이 있는 경우 snowconvert-support@snowflake.com으로 이메일을 보내주세요.