SnowConvert AI - Teradata Conversion Settings

常规转换设置

常规结果设置

“General Result Settings”子页面

  1. 注释缺失依赖项的对象: 该标志用于指示用户是否想要注释缺少依赖关系的节点。

  2. 禁用 EWI 注释生成(错误、警告和问题): 该标志用于指示是否不会在转换后的代码上生成 EWIs 注释(错误、警告和问题)。默认值为 false

  3. 为存储过程中的 SQL 语句生成 XML-标记: 该标志用于指明是否将在转换后的代码上标记存储过程中的 SQL 语句 SELECT、INSERT、CREATE、DELETE、UPDATE、DROP、MERGE。此功能用于在迁移后的代码上轻松识别语句。将这些语句封装在这些类似 XML 的标记中可以方便其他程序快速找到它们并进行提取。装饰后的代码如下所示:

    //<SQL_DELETE
    EXEC(DELETE FROM SB_EDP_SANDBOX_LAB.PUBLIC.USER_LIST,[])
    //SQL_DELETE!>
    
    Copy
  4. 将时段数据类型的定义和用法分成开始和结束数据时间字段: 该标志用于表示该工具应将 PERIOD 数据类型的任何使用迁移为两个单独的 DATETIME 字段,用于分别保存原始时间段的开始值和结束值,每当使用此标志迁移时间段字段或函数时,都会添加 SSC-EWI-TD0053,以提示该项更改。

    输入代码:

    CREATE TABLE myTable(
       col1 PERIOD(DATE),
       col2 VARCHAR(50),
       col3 PERIOD(TIMESTAMP)
    );
    
    Copy

    输出代码:

    CREATE OR REPLACE TABLE myTable (
       col1 VARCHAR(24) !!!RESOLVE EWI!!! /*** SSC-EWI-TD0053 - SNOWFLAKE DOES NOT SUPPORT THE PERIOD DATATYPE, ALL PERIODS ARE HANDLED AS VARCHAR INSTEAD ***/!!!,
       col2 VARCHAR(50),
       col3 VARCHAR(58) !!!RESOLVE EWI!!! /*** SSC-EWI-TD0053 - SNOWFLAKE DOES NOT SUPPORT THE PERIOD DATATYPE, ALL PERIODS ARE HANDLED AS VARCHAR INSTEAD ***/!!!
    )
    COMMENT = '{"origin":"sf_sc","name":"snowconvert","version":{"major":1, "minor":0},{"attributes":{"component":"teradata"}}'
    ;
    
    Copy
  5. Set encoding of the input files: Check General Conversion Settings for more details.

  6. Use COLLATE for Case Specification: This flag indicates whether to use COLLATE or UPPER to preserve Case Specification functionality, e.g. CASESPECIFIC or NOT CASESPECIFIC. By default, it is turned off, meaning that the UPPER function will be used to emulate case insensitivity (NOT CASESPECIFIC). To learn more about how Case Specification is handled by SnowConvert AI check here.

备注

要查看适用于所有支持语言的设置,请前往以下 文章

会话模式设置

此设置子页面用于指示输入代码的会话模式。

“Session Mode Settings”子页面

SnowConvert AI handles Teradata code in both TERA and ANSI modes. Currently, this is limited to the default case specification of character data and how it affects comparisons. By default, the Session Mode is TERA.

You can learn more about how SnowConvert AI handles and converts code depending on the session mode, check here.

DB 对象名称设置

“DB Objects Names Settings”页面

  1. 架构: 字符串值指定要应用的自定义架构名称。如果未指定,则将使用原始数据库名称。示例:DB1.myCustomSchema.Table1.

  2. 数据库: 字符串值指定要应用的自定义数据库名称。示例:MyCustomDB.PUBLIC.Table1.

  3. 默认值: 对象名称中将不使用上述任何设置。

准备代码设置

“Prepare Code Settings”页面

Description

Prepare my code: Flag to indicate whether the input code should be processed before parsing and transformation. This can be useful to improve the parsing process. By default, it's set to FALSE.

Splits the input code top-level objects into multiple files. The containing folders would be organized as follows:

└───A new folder named ''[input_folder_name]_Processed''
    └───Top-level object type
        └───Schema name
Copy

Example

Input

├───in
│       DDL_Macros.sql
│       DDL_Procedures.sql
│       DDL_Tables.sql
Copy

Output

Assume that the name of the files is the name of the top-level objects in the input files.


├───in_Processed
    ├───macro
    │   └───MY_DATABASE
    │           MY_FIRST_MACRO.sql
    │           ANOTHER_MACRO.sql
    │
    ├───procedure
    │   └───MY_DATABASE
    │           A_PROCEDURE.sql
    │           ANOTHER_PROCEDURE.sql
    │           YET_ANOTHER_PROCEDURE.sql
    │
    └───table
        └───MY_DATABASE
                MY_TABLE.sql
                ADDITIONAL_TABLE.sql
                THIRD_TABLE.sql
Copy

Inside the "schema name" folder, there should be as many files as top-level objects in the input code. Also, it is possible to have copies of some files when multiple same-type top-level objects have the same name. In this case, the file names will be enumerated in ascending order.

Only files with the ".sql", ".ddl" and ".dml" extensions will be considered for splitting. Other kinds of files like ".bteq" scripts will be copied into the preprocessed folder and will be categorized depending on the script extension but they won't be modified by the Split Task.

Requirements

To identify top-level objects, a tag must be included in a comment before their declaration. Our Extraction scripts generate these tags.

The tag should follow the next format:

<sc-top_level_object_type>top_level_object_name</sc-top_level_object_type>
Copy

You can follow the next example:

/* <sc-table> MY_DATABASE.MY_TABLE</sc-table> */
CREATE TABLE "MY_DATABASE"."MY_TABLE" (
    "MY_COLUMN" INTEGER
) ;
Copy

格式转换设置

“Format Conversion Settings”页面

  1. 字符到数字的默认小数位数: CHARACTER 到近似数字转换的整数值(默认值:10)。

  2. 默认 TIMESTAMP 格式: TIMESTAMP 格式的字符串值(默认值:“YYYY/MM/DD HH:MI:SS”)。

  3. 默认 DATE 格式: DATE 格式的字符串值(默认值:“YYYY/MM/DD”)。

  4. 源 TIMEZONE: TIMEZONE 格式的字符串值(默认值:“GMT-5”)。

  5. 默认 TIME 格式: TIME格式的字符串值(默认值“HH:MI:SS”)。

BTEQ 目标语言、过程/宏

“BTEQ Target Language Settings”页面

指定转换 Bteq 和 Mload 脚本文件的目标语言。目前支持的值是 SnowScriptPython。默认值设置为 Python

“Procedures/Macros Target Language Settings”页面

指定用于转换存储过程和宏的目标语言的字符串值。目前支持的是:SnowScriptJavaScript。默认值设置为 SnowScript

Reset Settings: The reset settings option appears on every page. If you've made changes, you can reset SnowConvert AI to its original default settings.

语言: 中文