SnowConvert AI - Teradata¶
What is SnowConvert AI for Teradata?¶
SnowConvert AI is a software that understands Teradata SQL, BTEQ, and other Teradata-specific scripts (such as Fastload, Multiload, TPump, and TPT files) and converts this source code into functionally equivalent Snowflake code.
변환 유형¶
Specifically, SnowConvert AI for Teradata performs the following conversions:
Teradata SQL 을 Snowflake SQL 로¶
SnowConvert AI understands the Teradata source code and converts the Data Definition Language (DDL), Data Manipulation Language (DML), and functions in the source code to the corresponding SQL in the target: Snowflake. SnowConvert AI can migrate the source code in any of these three extensions .sql, .dml, ddl
Teradata 저장 프로시저 JavaScript 에 포함된 Snowflake SQL¶
SnowConvert AI takes Teradata stored procedures (usually written in SQL) and converts them to JavaScript embedded into Snowflake SQL. Teradata’s CREATE PROCEDURE and REPLACE PROCEDURE language is replaced by Snowflake’s CREATE OR REPLACE PROCEDURE language. JavaScript is called as a scripting language, and all of the inner statements are converted to JavaScript.
Teradata BTEQ, Fastload, Multiload 및 TPT 를 Python으로¶
Basic Teradata Query (BTEQ) is Teradata’s proprietary scripting language. All BTEQ script files will be converted to Python scripts. A helper class will be called from the converted scripts to create the functional equivalence between the source and the target. More information about the Python Helpers can be found on our Translation Reference page. BTEQ can be batch run from outside the Snowflake environment. Learn more about how you can connect Python scripts directly to Snowflake.
BTEQ 파일은 Teradata가 생성한 다른 여러 독점 데이터 타입의 기반이기도 합니다.
Fastload
Multiload
TPUMP
Each one of these file types are extensions of BTEQ. SnowConvert AI translates each one of these file types to Python.
Each of these conversions are optimized to give you the most functionally equivalent output ready for use in Snowflake. For more information on the power of the kind of conversion SnowConvert AI can provide, you can learn more about our tool by visiting our complete SQL reference guide.
SnowConvert AI Terminology¶
이러한 코드 변환의 마법에 빠져들기 전에 몇 가지 용어/정의에 대한 설명서를 통해 그 의미를 이해할 수 있도록 몇 가지 용어를 소개합니다.
SQL (구조화된 쿼리 언어): 대부분의 최신 데이터베이스 아키텍처에서 데이터를 저장, 조작, 검색하기 위한 표준 언어입니다.
BTEQ (Basic Teradata Query): BTEQ was the first utility and query tool for Teradata.
TPT (Teradata Parallel Transporter): TPT 는 Teradata 데이터베이스에서 데이터를 로딩하고 내보내는 것과 관련된 모든 활동을 위한 원스톱 도구를 생성하는 것을 목표로 하는 차세대 유틸리티 도구입니다.
SnowConvert AI: the software that converts securely and automatically your Teradata files to the Snowflake cloud data platform.
Conversion rule or transformation rule: rules that allow SnowConvert AI to convert from a portion of source code to the expected target code.
Parse: parse or parsing is an initial process done by SnowConvert AI to understand the source code and build up an internal data structure to process the conversion rules.
On the next few pages, you’ll learn more about the kind of conversions that SnowConvert AI for Teradata is capable of. If you’re ready to get started, visit the Getting Started page in this documentation. If you’re interested in getting more information about SnowConvert AI in general, visit our SnowConvert AI for Teradata information page.
변환 샘플¶
Teradata SQL 문
-- CREATE TABLE DDL
CREATE SET TABLE TABLE1,
NO BEFORE JOURNAL,
NO AFTER JOURNAL,
CHECKSUM = DEFAULT,
DEFAULT MERGEBLOCKRATIO
(
COL1 VARCHAR(15) CHARACTER SET LATIN NOT CASESPECIFIC,
Col2 BYTEINT CHECK ( CurrentFlag IN (0 ,1 ) ) NOT NULL,
COL3 DATE FORMAT 'yyyy-mm-dd',
COL4 BLOB(2097088000),
COL5 BYTEINT,
COL7 INTEGER NOT NULL COMPRESS (1 ,2 ,3 ,4),
COL8 INTERVAL HOUR(2) TO MINUTE
);
-- REPLACE VIEW DDL
REPLACE VIEW VIEW1 AS
SELECT * FROM TABLE1
UNION ALL
SELECT MAX(COL1) FROM TABLE1;
변환된 Snowflake SQL 코드:
-- CREATE TABLE DDL
--** SSC-FDM-TD0024 - SET TABLE FUNCTIONALITY NOT SUPPORTED. TABLE MIGHT HAVE DUPLICATE ROWS **
CREATE OR REPLACE TABLE TABLE1
(
COL1 VARCHAR(15) COLLATE 'en-cs',
Col2 BYTEINT
!!!RESOLVE EWI!!! /*** SSC-EWI-0035 - CHECK STATEMENT NOT SUPPORTED ***/!!!
CHECK ( CurrentFlag IN (0 ,1 ) ) NOT NULL,
COL3 DATE,
COL4 BINARY /*** SSC-FDM-TD0001 - COLUMN CONVERTED FROM BLOB DATA TYPE ***/,
COL5 BYTEINT,
COL7 INTEGER NOT NULL,
COL8 VARCHAR(21) !!!RESOLVE EWI!!! /*** SSC-EWI-0036 - INTERVAL HOUR(2) TO MINUTE DATA TYPE CONVERTED TO VARCHAR ***/!!!
)
COMMENT = '{"origin":"sf_sc","name":"snowconvert","version":{"major":1, "minor":0},"attributes":{"component":"teradata"}}'
;
-- REPLACE VIEW DDL
CREATE OR REPLACE VIEW VIEW1
COMMENT = '{"origin":"sf_sc","name":"snowconvert","version":{"major":1, "minor":0},"attributes":{"component":"teradata"}}'
AS
SELECT
* FROM
TABLE1
UNION ALL
SELECT
MAX(COL1) FROM
TABLE1;
이 변환된 SQL 에서는 다음과 같은 많은 것들이 변환되고 있음을 알 수 있습니다.
사용자가 스키마를 지정하지 않은 경우 모든 테이블 및 뷰 이름에 기본적으로
PUBLIC
스키마를 추가합니다(스키마 지정 방법 참조).CREATE SET TABLE
에서CREATE TABLE
로REPLACE VIEW
에서CREATE OR REPLACE VIEW
로데이터 타입:
BLOB
에서BINARY
로,INTERVAL
에서VARCHAR
로데이터 타입 특성:
NOTCASESPECIFIC
에서COLLATE
로NO BEFORE JOURNAL
,NO AFTER JOURNAL
,CHECKSUM
,COMPRESS
,DEFAULT MERGEBLOCKRATIO
같은 Snowflake의 아키텍처로 인해 필요하지 않은 Teradata SQL 의 일부를 제거합니다 .