SnowConvert AI - Scripts - Identified Objects

备注

文档的本页面仅适用于 Teradata。

在所有脚本文件(BTEQ、BTQ、FL、ML、TPUMP、TPT)中创建或修改的所有数据库对象的细分。

Teradata 评估报告的脚本 - 已识别对象部分。

转换率 - 对象

备注

如果一个对象没有出现中等、高或严重的问题,则将该对象视为成功迁移。

Represents the percentage of identified objects by SnowConvert AI that were successfully migrated. This will help to determine the number of objects that were successfully migrated and the objects that need manual work in order to complete the migration of the objects to Snowflake. If N/A is listed in the column, it means that the object type is not supported in Snowflake. A "-" could also be listed in this column, this means that the set of files migrated by SnowConvert AI did not contain objects of the specific type that could be identified.

公式

(successfully_converted_scripts_objects / total_scripts_objects) * 100
Copy

CSV 关联的字段名称

  • 表: ScriptTableObjectConversionRate

  • 视图: ScriptViewObjectConversionRate

  • 联接索引: ScriptJoinIndexObjectConversionRate

  • 宏: ScriptMacroObjectConversionRate

  • 过程: ScriptProcedureObjectConversionRate

  • 函数: ScriptFunctionObjectConversionRate

  • 触发器:ScriptTriggerObjectConversionRate

  • 索引: 不适用

示例

CREATE SET TABLE Tables_Database.Employee
   (Associate_Id     INTEGER)
UNIQUE PRIMARY INDEX (Associate_Id);

CRATE SET TABLE Tables_Database.Employee2
   (Associate_Id     INTEGER)
UNIQUE PRIMARY INDEX (Associate_Id);
Copy
#*** Generated code is based on the SnowConvert AI Python Helpers version 2.0.6 ***

import os
import sys
import snowconvert.helpers
from snowconvert.helpers import Export
from snowconvert.helpers import exec
from snowconvert.helpers import BeginLoading
con = None
def main():
  snowconvert.helpers.configure_log()
  con = snowconvert.helpers.log_on()
  exec("""
    --** SSC-FDM-TD0024 - SET TABLE FUNCTIONALITY NOT SUPPORTED. TABLE MIGHT HAVE DUPLICATE ROWS **
    CREATE OR REPLACE TABLE Tables_Database.Employee (
      Associate_Id INTEGER,
      UNIQUE (Associate_Id)
    )
    """)
  #** SSC-EWI-0001 - UNRECOGNIZED TOKEN ON LINE '5' COLUMN '1' OF THE SOURCE CODE STARTING AT 'CRATE'. EXPECTED 'STATEMENT' GRAMMAR. LAST MATCHING TOKEN WAS 'CRATE' ON LINE '5' COLUMN '1'. CODE '81'. **
  #
  #--CRATE SET TABLE Tables_Database.Employee2
  #--   (Associate_Id     INTEGER)
  #--UNIQUE PRIMARY INDEX (Associate_Id)

  snowconvert.helpers.quit_application()

if __name__ == "__main__":
  main()
Copy

预期对象转换率: 50%

解释: 根据之前的示例代码,我们的对象转换率将达到 50%,因为 2 个已识别表中只有 1 个成功迁移到 Snowflake。

转换率 - 代码行数 (LOC)

表示每个文件扩展名的代码行数转换百分比。

公式

(script_success_lines / script_total_lines) * 100
Copy

关联的 CSV 字段名称

  • 表: ScriptTableLoCConversionRate

  • 视图: ScriptViewLocConversionRate

  • 联接索引: ScriptJoinIndexLoCConversionRate

  • 宏: ScriptMacroLoCConversionRate

  • 过程: ScriptProcedureLoCConversionRate

  • 函数: ScriptFunctionLoCConversionRate

  • 触发器:ScriptTriggerLoCConversionRate

  • 索引: 不适用

示例

CREATE SET TABLE Tables_Database.Employee
   (Associate_Id     INTEGER)
UNIQUE PRIMARY INDEX (Associate_Id);

CREATE SET TABLE Tables_Database.Employee2
   (Associate_Id     ANYTYPE!)
UNIQUE PRIMARY INDEX (Associate_Id);
Copy
#*** Generated code is based on the SnowConvert AI Python Helpers version 2.0.6 ***

import os
import sys
import snowconvert.helpers
from snowconvert.helpers import Export
from snowconvert.helpers import exec
from snowconvert.helpers import BeginLoading
con = None
def main():
  snowconvert.helpers.configure_log()
  con = snowconvert.helpers.log_on()
  exec("""
    --** SSC-FDM-TD0024 - SET TABLE FUNCTIONALITY NOT SUPPORTED. TABLE MIGHT HAVE DUPLICATE ROWS **
    CREATE OR REPLACE TABLE Tables_Database.Employee (
      Associate_Id INTEGER,
      UNIQUE (Associate_Id)
    )
    """)
  exec("""
    --** SSC-FDM-TD0024 - SET TABLE FUNCTIONALITY NOT SUPPORTED. TABLE MIGHT HAVE DUPLICATE ROWS **
    CREATE OR REPLACE TABLE Tables_Database.Employee2 (
-- ** SSC-EWI-0001 - UNRECOGNIZED TOKEN ON LINE '6' COLUMN '5' OF THE SOURCE CODE STARTING AT 'Associate_Id'. EXPECTED 'Column Definition' GRAMMAR. LAST MATCHING TOKEN WAS 'ANYTYPE' ON LINE '6' COLUMN '22'. CODE '15'. **
--                                                       Associate_Id     ANYTYPE!,
      UNIQUE (Associate_Id)
    )
    """)
  snowconvert.helpers.quit_application()

if __name__ == "__main__":
  main()
Copy

预期的 LOC 转换率:83.33%

解释: 根据前面的示例代码,LOC 转换率为 83.33%,因为输入代码 (Associate_Id ANYTYPE!) 中的第 5 行无法迁移,总共 6 行代码中只有 5 行成功迁移。

备注

您可以在我们文档的 转换率模式 部分查看更多相关信息。

对象总数

Represents the total amount of objects identified by SnowConvert AI during the parsing phase.

CSV 关联的字段名称

  • 表: ScriptTableTotalOccurrences

  • 视图: ScriptViewTotalOccurrences

  • 联接索引: ScriptJoinIndexTotalOccurrences

  • 宏: ScriptMacroTotalOccurrences

  • 过程: ScriptProcedureTotalOccurrences

  • 函数: ScriptFunctionTotalOccurrences

  • 触发器:ScriptTriggerTotalOccurrences

  • 索引: ScriptIndexTotalOccurrences

示例

-- Successfully parsed table.
CREATE SET TABLE Tables_Database.Employee
   (Associate_Id     INTEGER)
UNIQUE PRIMARY INDEX (Associate_Id);

-- Table with a parsing error that could not be identified.
CRATE SET TABLE Tables_Database.Employee2
   (Associate_Id     INTEGER)
UNIQUE PRIMARY INDEX (Associate_Id);
Copy
#*** Generated code is based on the SnowConvert AI Python Helpers version 2.0.6 ***

import os
import sys
import snowconvert.helpers
from snowconvert.helpers import Export
from snowconvert.helpers import exec
from snowconvert.helpers import BeginLoading
con = None
def main():
  snowconvert.helpers.configure_log()
  con = snowconvert.helpers.log_on()
  # Successfully parsed table.
  exec("""
    --** SSC-FDM-TD0024 - SET TABLE FUNCTIONALITY NOT SUPPORTED. TABLE MIGHT HAVE DUPLICATE ROWS **
    CREATE OR REPLACE TABLE Tables_Database.Employee (
      Associate_Id INTEGER,
      UNIQUE (Associate_Id)
    )
    """)
  #** SSC-EWI-0001 - UNRECOGNIZED TOKEN ON LINE '7' COLUMN '1' OF THE SOURCE CODE STARTING AT 'CRATE'. EXPECTED 'STATEMENT' GRAMMAR. LAST MATCHING TOKEN WAS 'CRATE' ON LINE '7' COLUMN '1'. CODE '81'. **
  #
  #---- Table with a parsing error that could not be identified.
  #--CRATE SET TABLE Tables_Database.Employee2
  #--   (Associate_Id     INTEGER)
  #--UNIQUE PRIMARY INDEX (Associate_Id)

  snowconvert.helpers.quit_application()

if __name__ == "__main__":
  main()
Copy

预期对象总数: 1。

Explanation: One table was completely parsed by SnowConvert AI during the parsing phase but the other table has a parsing error that causes SnowConvert AI to not identify it as a table object.

代码行数

表示用于已识别顶级对象的总代码行数。需要特别注意的是,顶层对象的代码行数以及注释都会用于此列。另一方面,空行不会计入此列。

CSV 关联的字段名称

  • 表: ScriptTableTotalLinesOfCode

  • 视图: ScriptViewTotalLinesOfCode

  • 联接索引: ScriptJoinIndexTotalLinesOfCode

  • 宏: ScriptMacroTotalLinesOfCode

  • 过程: ScriptProcedureTotalLinesOfCode

  • 函数: ScriptFunctionTotalLinesOfCode

  • 触发器:ScriptTriggerTotalLinesOfCode

  • 索引: ScriptIndexTotalLinesOfCode

示例

-- Hello World
CREATE SET TABLE Tables_Database.Employee
   (Associate_Id     INTEGER)
UNIQUE PRIMARY INDEX (Associate_Id);

CREATE SET TABLE Tables_Database.Employee2
   (-- hello world
   Associate_Id     ANYTYPE!)
UNIQUE PRIMARY INDEX (Associate_Id);
Copy
#*** Generated code is based on the SnowConvert AI Python Helpers version 2.0.6 ***

import os
import sys
import snowconvert.helpers
from snowconvert.helpers import Export
from snowconvert.helpers import exec
from snowconvert.helpers import BeginLoading
con = None
def main():
  snowconvert.helpers.configure_log()
  con = snowconvert.helpers.log_on()
  # Hello World
  exec("""
    --** SSC-FDM-TD0024 - SET TABLE FUNCTIONALITY NOT SUPPORTED. TABLE MIGHT HAVE DUPLICATE ROWS **
    CREATE OR REPLACE TABLE Tables_Database.Employee (
      Associate_Id INTEGER,
      UNIQUE (Associate_Id)
    )
    """)
  # hello world
  exec("""
    --** SSC-FDM-TD0024 - SET TABLE FUNCTIONALITY NOT SUPPORTED. TABLE MIGHT HAVE DUPLICATE ROWS **
    CREATE OR REPLACE TABLE Tables_Database.Employee2 (
-- ** SSC-EWI-0001 - UNRECOGNIZED TOKEN ON LINE '8' COLUMN '4' OF THE SOURCE CODE STARTING AT 'Associate_Id'. EXPECTED 'Column Definition' GRAMMAR. LAST MATCHING TOKEN WAS 'ANYTYPE' ON LINE '8' COLUMN '21'. CODE '15'. **
--   Associate_Id     ANYTYPE!,
      UNIQUE (Associate_Id)
    )
    """)
  snowconvert.helpers.quit_application()

if __name__ == "__main__":
  main()
Copy

预期代码行数: 8

解释: 在这种情况下,来自 CREATE TABLE 语句的代码占 6 行,而顶层对象内包含的注释占 2 行。

解析错误

表示已识别对象内部的解析错误的数量。

CSV 关联的字段名称

  • 表: ScriptTableTotalParsingErrors

  • 视图: ScriptViewTotalParsingErrors

  • 联接索引: ScriptJoinIndexTotalParsingErrors

  • 宏: ScriptMacroTotalLinesOfCode

  • 过程: ScriptProcedureTotalParsingErrors

  • 函数: ScriptFunctionTotalParsingErrors

  • 触发器:ScriptTriggerTotalParsingErrors

  • 索引: ScriptIndexTotalParsingErrors

示例

-- Successfully parsed table.
CREATE SET TABLE Tables_Database.Employee
   (Associate_Id     INTEGER)
UNIQUE PRIMARY INDEX (Associate_Id);

-- Table with a parsing error that could not be identified.
CRATE SET TABLE Tables_Database.Employee2
   (Associate_Id     INTEGER)
UNIQUE PRIMARY INDEX (Associate_Id);
Copy
#*** Generated code is based on the SnowConvert AI Python Helpers version 2.0.6 ***

import os
import sys
import snowconvert.helpers
from snowconvert.helpers import Export
from snowconvert.helpers import exec
from snowconvert.helpers import BeginLoading
con = None
def main():
  snowconvert.helpers.configure_log()
  con = snowconvert.helpers.log_on()
  # Successfully parsed table.
  exec("""
    --** SSC-FDM-TD0024 - SET TABLE FUNCTIONALITY NOT SUPPORTED. TABLE MIGHT HAVE DUPLICATE ROWS **
    CREATE OR REPLACE TABLE Tables_Database.Employee (
      Associate_Id INTEGER,
      UNIQUE (Associate_Id)
    )
    """)
  #** SSC-EWI-0001 - UNRECOGNIZED TOKEN ON LINE '7' COLUMN '1' OF THE SOURCE CODE STARTING AT 'CRATE'. EXPECTED 'STATEMENT' GRAMMAR. LAST MATCHING TOKEN WAS 'CRATE' ON LINE '7' COLUMN '1'. CODE '81'. **
  #
  #---- Table with a parsing error that could not be identified.
  #--CRATE SET TABLE Tables_Database.Employee2
  #--   (Associate_Id     INTEGER)
  #--UNIQUE PRIMARY INDEX (Associate_Id)

  snowconvert.helpers.quit_application()

if __name__ == "__main__":
  main()
Copy

预期解析错误数: 1

Explanation: Only one parsing error will be reported in the Parsing Errors column because SnowConvert AI was able to only identify the first table. Since the second table was not identified, those parsing errors will not be counted in the Parsing Errors column.

语言: 中文