Snowpark Migration Accelerator: SMA 清单¶
Snowpark Migration Accelerator (SMA) 会分析您的代码库并生成详细数据,这些数据作为电子表格(清单)存储在“Reports”文件夹中。此数据用于创建两种报告类型:
一开始了解清单文件似乎令人望而生畏,但它们可为您的源工作负载和转换后的工作负载提供宝贵的见解。下面,我们将详细解释每个输出文件及其列。
这些清单还通过遥测数据收集实现共享。有关更多详细信息,请参阅本文档的遥测部分。
评估报告详情¶
AssessmentReport.json 文件存储在应用程序的“Detailed Report”和“Assessment Summary”部分中均显示的数据。此文件主要用于填充这些报告,并且可能包含在其他电子表格中也可用的信息。
DBX Elements Inventory¶
The DbxElementsInventory.csv lists the DBX elements found inside notebooks.
Element: The DBX element name.
ProjectId: Name of the project (root directory the tool was run on)
FileId: File where the element was found and the relative path to that file.
Count: The number of times that element shows up in a single line.
Category: The element category.
Alias: The alias of the element (applies just for import elements).
Kind: A category for each element. These could include Function or Magic.
Line: The line number in the source files where the element was found.
PackageName: The name of the package where the element was found.
Supported: Whether this reference is “supported” or not. Values: True/False.
Automated: Whether or not the tool can automatically convert it. Values: True/False.
Status: The categorization of each element. The options are Rename, Direct, Helper, Transformation, WorkAround, NotSupported, NotDefined.
Statement: The code where the element was used. [NOTE: This column is not sent via telemetry.]
SessionId: Unique identifier for each run of the tool.
SnowConvertCoreVersion: The version number for the core code process of the tool.
SnowparkVersion: The version of Snowpark API available for the specified technology and run of the tool.
CellId: If this element was found in a notebook file, the numbered location of the cell where this element was in the file.
ExecutionId: The unique identifier for this execution of the SMA.
Execution Flow Inventory¶
The ExecutionFlowInventory.csv lists the relations between the different workload scopes, based on the function calls found. This inventory main purpose is to serve as the base for the entry points identification.
Caller: The full name of the scope where the call was found.
CallerType: The type of the scope where the call was found. This can be: Function, Class, or Module.
Invoked: The full name of the element that was called.
InvokedType: The type of the element. This can be: Function or Class.
FileId: The relative path of the file. (Starting from the input folder the user chose in the SMA tool)
CellId: The cell number where the call was found inside a notebook file, if applies.
Line: The line number where the call was found.
Column: The column number where the call was found.
ExecutionId: The execution id.
Checkpoints Inventory¶
The Checkpoints.csv lists the generated checkpoints for the user workload, these checkpoints are completely capable to be used in the Checkpoints Feature from the Snowflake Exentesion.
Name: The checkpoint name (using the format described before).
FileId: the relative path of the file (starting from the input folder the user chose in the SMA tool).
CellId: the number of cell where the DataFrame operation was found inside a notebook file.
Line: line number where the DataFrame operation was found.
Column: the column number where the DataFrame operation was found.
Type: the use case of the checkpoints (Collection or Validation).
DataFrameName: The name of the DataFrame.
Location: The assignment number of the DataFrame name.
Enabled: Indicates whether the checkpoint is enabled (True or False).
Mode: The mode number of the collection (Schema [1] or DataFrame [2]).
Sample: The sample of the DataFrame.
EntryPoint: The entry point that guide the flow to execute the checkpoint.
ExecutionId: the execution id.
DataFrames Inventory¶
The DataFramesInventory.csv lists the dataframes assignments found in order to be used to generate checkpoints for the user workload.
FullName: The full name of the DataFrame.
Name: The simple name of the variable of the DataFrame.
FileId: The relative path of the file (starting from the input folder the user chose in the SMA tool).
CellId: The number of cells where the DataFrame operation was found inside a notebook file.
Line: The line number where the DataFrame operation was found.
Column: The column number where the DataFrame operation was found.
AssignmentNumber: The number of assignments for this particular identifier (not symbol) in the file.
RelevantFunction: The relevant function why this was collected.
RelatedDataFrames: The full qualified name of the DataFrame(s) involved in the operation (separated by semicolon).
EntryPoints: it will be empty for this phase. In a later phase, it will be filled.
ExecutionId: the execution id.
Artifact Dependency Inventory¶
The ArtifactDependencyInventory.csv lists the artifact dependencies of each file analyzed by the SMA. This inventory allows the user to determine which artifacts are needed for the file to work properly in Snowflake.
The following are considered artifacts: a third-party library, SQL entity, source of a read or write operation, and another source code file in the workload.
ExecutionId: the identifier of the execution.
FileId: the identifier of the source code file.
Dependency: the artifact dependency that the current file has.
Type: the type of the artifact dependency.
UserCodeFile: source code or notebook.
IOSources: resource required for input and output operation.
ThirdPartyLibraries: a third-party library.
UnknownLibraries: a library whose origin was not determined by SMA.
SQLObjects: an SQL entity: table or view, for example.
Success: If the artifact needs any intervention, it shows FALSE; otherwise, it shows TRUE.
Status_Detail: the status of the artifact dependency, based on the type.
UserCodeFile:
Parsed: the file was parsed successfully.
NotParsed: the file parsing failed.
IOSources:
Exists: the resource of the operation is in the workload.
DoesNotExists: the resource of the operation is not present in the input.
ThirdPartyLibraries:
Supported: the library is supported by Snowpark Anaconda.
NotSupported: the library is not supported by Snowpark Anaconda.
UnknownLibraries:
NotSupported: since the origin was not determined by SMA.
SQLObject
DoesNotExists: the embedded statement that creates the entity is not in the input source code.
Exists: the embedded statement that creates the entity is in the input source code.
Arguments: an extra data of the artifact dependency, based on the type.
Location: the collection of cell ID and line number where the artifact dependency is being used in the source code file.
IndirectDependencies: A list of other files that this file relies on, even if not directly.
TotalIndirectDependencies: The total count of these indirect dependencies.
DirectParents: A list of files that directly use this file.
TotalDirectParents: The total count of these direct parent files.
IndirectParents: A list of files that use this file indirectly (through other files).
TotalIndirectParents: The total count of these indirect parent files.
文件清单¶
files.csv 包含工具执行期间处理的所有文件的完整列表,包括其文件类型和大小。
Path:相对于根目录的文件位置。例如,根目录中的文件将仅显示其文件名。
Technology:源代码的编程语言(Python 或 Scala)
FileKind:识别文件是包含源代码还是其他类型(如文本或日志文件)
BinaryKind:表示该文件是人类可读的文本文件还是二进制文件
Bytes:以字节为单位的文件大小
SupportedStatus:始终显示“DoesNotApply”,因为文件支持状态不适用于此上下文
导入使用情况清单¶
ImportUsagesInventory.csv 文件包含代码库中所有外部库导入的列表。外部库是导入到源代码文件中的任何包或模块。
Element:用于 Spark 参考的唯一标识符
ProjectId:执行该工具的根目录的名称
FileId:包含 Spark 参考的相对路径和文件名
Count:该元素在一行中出现的次数
Alias:元素的可选替代名称
Kind:始终为空/null,因为所有元素都是导入的
Line:元素出现的源代码行号
PackageName:包含元素的包
Supported:表示是否可以转换参考 (True/False)
Automated:空/null(已弃用的列)
Status:始终为“Invalid”(已弃用的列)
Statement:使用元素的实际代码 [不包含在遥测中]
SessionId:每个工具执行的唯一标识符
SnowConvertCoreVersion:该工具核心处理引擎的版本号
SnowparkVersion:对于特定技术可用的 Snowpark API 版本
ElementPackage:包含导入元素的包名称(如果可用)
CellId:对于笔记本文件,表示包含该元素的单元格号
ExecutionId:此 SMA 执行的唯一标识符
Origin:导入的源类型(BuiltIn、ThirdPartyLib 或空白)
输入文件清单¶
InputFilesInventory.csv 文件包含所有文件的详细列表,按文件类型和大小排列。
Element:文件名,与 FileId 相同
ProjectId:项目名称,由执行该工具的根目录表示
FileId:包含 Spark 参考的文件的完整路径,显示为相对路径
Count:共享此文件名的文件数量
SessionId:分配给每个工具会话的唯一标识符
Extension:文件扩展名类型
Technology:编程语言或技术类型,由文件扩展名决定
Bytes:以字节为单位的文件大小
CharacterLength:文件中字符的总数
LinesOfCode:文件中代码行的总数
ParsingResult:表示单元格是成功解析(“Successful”)还是发生错误(“Error”)
输入和输出文件清单¶
IOFilesInventory.csv 文件包含代码读取或写入的所有外部文件和资源的列表。
Element:用于读写操作而访问的特定项目(文件、变量或组件)
ProjectId:执行该工具的根目录的名称
FileId:检测到 Spark 代码的完整路径和文件名
Count:此文件名出现的次数
isLiteral:表示是否将读/写位置指定为字面量值
Format:检测到的文件格式,如 CSV 和 JSON(如果 SMA 可以识别它)
FormatType:指定标识的格式是否显式
Mode:表示操作是“读取”还是“写入”
Supported:表示 Snowpark 是否支持此操作
Line:文件中发生读写操作的行号
SessionId:分配给每个工具会话的唯一标识符
OptionalSettings:列出为元素定义的所有其他参数
CellId:对于笔记本文件,标识特定的单元格位置(非笔记本文件为 null)
ExecutionId:每次运行该工具时的唯一标识符
问题清单¶
Issues.csv 文件包含在代码库中发现的所有转换问题的详细报告。对于每一个问题,您会发现:
介绍问题的描述
文件中出现问题的确切位置
问题类型的唯一代码标识符
有关特定问题的更多详细信息,请参阅文档中的 问题分析 部分。
Code:分配给工具检测到的每个问题的唯一标识符
Description:对问题的详细说明,包括 Spark 参考名称(如果适用)
Category:发现的问题类型,可以是以下类型之一:
警告
转换错误
解析错误
辅助函数
Transformation
WorkAround
NotSupported
NotDefined
NodeType:检测到问题的语法节点标识符
FileId:Spark 参考所在未知的相对路径和文件名
ProjectId:执行该工具的根目录的名称
Line:源文件中出现问题的特定行号
Column:行中出现问题的字符的具体位置
联接清单¶
JoinsInventory.csv 文件包含在代码库中找到的所有数据框联接操作的完整列表。
Element:行号表示联接的起点(如果跨越多行,则表示联接的终点)
ProjectId:执行该工具的根目录名称
FileId:包含 Spark 参考的文件路径和名称
Count:具有相同文件名的文件数
isSelfJoin:如果将表与其自身联接,则为 TRUE,否则为 FALSE
HasLeftAlias:如果为联接的左侧定义了别名,则为 TRUE,否则为 FALSE
HasRightAlias:如果为联接的右侧定义了别名,则为 TRUE,否则为 FALSE
Line:联接的起始行号
SessionId:分配给每个工具会话的唯一标识符
CellId:包含元素的笔记本单元格的标识符(非笔记本文件为 null)
ExecutionId:每个工具执行的唯一标识符
笔记本单元格清单¶
NotebookCellsInventory.csv 文件提供了笔记本中所有单元格的详细列表,包括其源代码内容和每个单元的代码行数。
Element:源代码中使用的编程语言(Python、Scala 或 SQL)
ProjectId:执行该工具的根目录的名称
FileId:检测到 Spark 代码的完整路径和文件名
Count:具有此特定文件名的文件数量
CellId:对于笔记本文件,包含代码的单元格的唯一标识符(非笔记本文件为 null)
Argument:此字段始终为空 (null)
LOC:单元格中代码行的总数
Size:单元格中的字符总数
SupportedStatus:表示单元格中是否支持所有元素 (TRUE),或者是否存在不支持的元素 (FALSE)
ParsingResult:显示单元格是否已成功解析(“Successful”)或是否存在解析错误(“Error”)
笔记本尺寸清单¶
NotebookSizeInventory.csv 文件提供了笔记本文件中每种编程语言的代码行摘要。
filename:电子表格文件的名称(与 FileId 相同)
ProjectId:执行该工具的根目录的名称
FileId:包含 Spark 参考的文件的相对路径和名称
Count:具有此特定文件名的文件数量
PythonLOC:笔记本单元格中的 Python 代码行数(常规文件为零)
ScalaLOC:笔记本单元格中的 Scala 代码行数(常规文件为零)
SqlLOC:笔记本单元格中的 SQL 代码行数(常规文件为零)
Line:此字段始终为空 (null)
SessionId:分配给每个工具会话的唯一标识符
ExecutionId:分配给每个工具执行的唯一标识符
Pandas 使用情况清单¶
PandasUsagesInventory.csv 文件包含扫描过程中在 Python 代码库中找到的所有 Pandas API 参考的完整列表。
Element:Pandas 参考的唯一标识符
ProjectId:执行该工具的根目录的名称
FileId:包含 Spark 参考的文件的相对路径
Count:该元素在一行中出现的次数
Alias:用于元素的替代名称(仅适用于导入)
Kind:元素的类型,如类、变量、函数、导入等
Line:元素所在的源文件行号
PackageName:包含元素的包
Supported:表示是否支持该参考 (True/False)
Automated:表示该工具是否可以自动转换元素 (True/False)
Status:元素分类:Rename、Direct、Helper、Transformation、WorkAround、NotSupported 或 NotDefined
Statement:使用元素时的上下文 [不包含在遥测中]
SessionId:每个工具执行的唯一标识符
SnowConvertCoreVersion:该工具的核心处理代码的版本号
SnowparkVersion:对于特定技术和工具运行可用的 Snowpark API 版本
PandasVersion:用于识别代码库中元素的 pandas API 版本
CellId:FileId 中的单元格标识符(仅适用于笔记本电脑,否则为 null)
ExecutionId:每个工具执行的唯一标识符
Spark 使用情况清单¶
SparkUsagesInventory.csv 文件确定了在代码中使用 Spark API 函数的位置和方式。此信息有助于计算 就绪度分数,这表示代码对于迁移的准备情况。
Element:用于 Spark 参考的唯一标识符
ProjectId:执行该工具的根目录的名称
FileId:包含 Spark 参考的相对路径和文件名
Count:该元素在一行中出现的次数
Alias:元素的别名(仅适用于导入元素)
Kind:元素的类别(例如类、变量、函数、导入)
Line:元素所在的源文件行号
PackageName:包含元素的包名
Supported:表示是否支持该参考 (True/False)
Automated:表示该工具是否可以自动转换元素 (True/False)
Status:元素分类(重命名、直接映射、辅助函数、转换、WorkAround、NotSupported、NotDefined)
Statement:使用该元素的实际代码 [NOTE:此列不是通过遥测发送的]
SessionId:每个工具执行的唯一标识符
SnowConvertCoreVersion:该工具的核心处理版本号
SnowparkVersion:对于特定技术和工具运行可用的 Snowpark API 版本
CellId:对于笔记本文件,是单元格中元素所在的数字位置
ExecutionId:此特定 SMA 执行的唯一标识符
SqlStatementsInventory.csv 文件包含在 Spark SQL 元素中找到的 SQL 关键字的计数。
Element:包含 SQL 语句的代码元素的名称
ProjectId:执行该工具的根目录名称
FileId:包含 Spark 参考的文件的相对路径
Count:该元素在一行中出现的次数
InterpolationCount:插入该元素的外部元素的数量
Keywords:包含 SQL 关键字及其出现频率的字典
Size:SQL 语句的总字符数
LiteralCount:元素中字符串字面量的数量
NonLiteralCount:非字符串字面量的 SQL 组件的数量
Line:元素所在的行号
SessionId:每个工具会话的唯一标识符
CellId:包含该元素的笔记本单元格的标识符(如果不在笔记本中则为 null)
ExecutionId:每个工具执行的唯一标识符
SQL 元素清单¶
SQLElementsInventory.csv 文件包含在 Spark SQL 元素中找到的 SQL 语句的计数。
以下是 SQL 分析报告中包含的字段:
Element:SQL 代码元素类型(如:SqlSelect、SqlFromClause)
ProjectId:执行该工具的根目录名称
FileId:包含 SQL 代码的文件路径
Count:该元素在一行中出现的次数
NotebookCellId:笔记本单元格的 ID
Line:元素所在的行号
Column:元素所在的列号
SessionId:每个工具会话的唯一 ID
ExecutionId:每个工具运行的唯一 ID
SqlFlavor:正在分析的 SQL 类型(如:Spark SQL、Hive SQL)
RootFullName:主代码元素的完整名称
RootLine:主元素的行号
RootColumn:主元素的列号
TopLevelFullName:最高级别 SQL 语句的完整名称
TopLevelLine:最高级别语句的行号
TopLevelColumn:最高级别语句的列号
ConversionStatus:SQL 转换的结果(如:Success、Failed)
Category:SQL 语句的类型(如:DDL、DML、DQL)
EWI:错误警告信息代码
ObjectReference:被参考的 SQL 对象的名称(如:表名、视图名称)
SQL 嵌入式使用情况清单¶
SqlEmbeddedUsageInventory.csv 文件包含在 Spark SQL 元素中找到的 SQL 关键字的计数。
Element:在代码中找到的 SQL 组件的类型(例如 Select 语句、From 子句或 Numeric 字面量)
ProjectId:执行该工具的根目录的名称
FileId:包含 SQL 参考的文件的位置和相对路径
Count:此元素在一行中出现的次数
ExecutionId:分配给每个工具执行的唯一 ID
LibraryName:正在使用的库的名称
HasLiteral:显示元素是否包含字面量值
HasVariable:显示元素是否包含变量
HasFunction:显示元素是否包含函数调用
ParsingStatus:当前的解析状态(Success、Failed 或 Partial)
HasInterpolation:显示元素是否包含字符串插值
CellId:用于笔记本单元格的标识符
Line:元素所在的行号
Column:元素所在的列号
第三方使用情况清单¶
ThirdPartyUsagesInventory.csv 文件包含
Element:供第三方参考的唯一标识符
ProjectId:执行该工具的项目根目录的名称
FileId:包含 Spark 参考的文件的相对路径
Count:该元素在一行中出现的次数
Alias:分配给元素的替代名称(如果适用)
Kind:元素的类型分类(变量、类型、函数或类)
Line:元素所在的源文件行号
PackageName:完整的包名称(Python 中的 ProjectId 和 FileId 的组合)
Statement:使用该元素的实际代码 [NOTE:不包含在遥测数据中]
SessionId:每个工具会话的唯一标识符
CellId:元素所在的笔记本单元格标识符(非笔记本文件为 null)
ExecutionId:每个工具执行的唯一标识符
包清单¶
packagesInventory.csv 文件包含
Package Name:正在分析的包的名称。
Project Name:项目的名称,对应着执行该工具的根目录。
File Location:包所在的文件路径,显示为相对路径。
Occurrence Count:此包在一行代码中出现的次数。
工具执行摘要¶
tool_execution.csv 文件包含有关 Snowpark Migration Accelerator (SMA) 工具当前执行情况的基本信息。
ExecutionId:每次运行工具时分配给的唯一标识符。
ToolName:正在使用的工具的名称。可以是 PythonSnowConvert 或 SparkSnowConvert(适用于 Scala)。
Tool_Version:软件的版本号
AssemblyName:代码处理器的完整名称(ToolName 的更详细版本)。
LogFile:表示发生错误或故障时是否生成日志文件。
FinalResult:表示在发生错误或故障时工具停止的位置。
ExceptionReport:表示发生故障时是否生成了错误报告。
StartTime:工具开始运行的日期和时间。
EndTime:工具完成运行的日期和时间。
SystemName:运行该工具的机器序列号(仅用于故障排除和验证许可证)。