Snowpark Migration Accelerator: SMA インベントリ

Snowpark Migration Accelerator(SMA)は、コードベースを分析して詳細なデータを作成し、スプレッドシート(インベントリ)としてReportsフォルダーに保存されます。このデータは、2つのタイプのレポートを作成するために使用されます。

  1. 評価の概要

  2. 厳選レポート

インベントリファイルを理解することは、最初は難しく感じるかもしれませんが、ソースワークロードと変換後のワークロードの両方について貴重な洞察を与えてくれます。以下、各出力ファイルとその列について詳しく説明します。

これらのインベントリは、テレメトリデータ収集を通じても共有されます。詳細については、このドキュメントのテレメトリセクションをご参照ください。

評価レポート詳細

AssessmentReport.json ファイルには、アプリケーションの詳細レポートセクションと評価の概要セクションの両方に表示されるデータが保存されています。このファイルは主にこれらのレポートを作成するために使用され、他のスプレッドシートでも利用可能な情報が含まれている場合があります。

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: 1行に出現する要素の数

  • Alias: 要素のオプションの別名

  • Kind: すべての要素がインポートされるため、常に空/null

  • Line: 要素が現れるソースコードの行番号

  • PackageName: 要素を含むパッケージ

  • Supported: 参照が変換可能かどうかを示します(True/False)

  • Automated: 空/null(廃止された列)

  • Status: 常に「無効」(廃止された列)

  • 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: SMA が識別できる場合は、検出されたファイル形式(CSV や JSON など)。

  • FormatType: 識別された形式が明示的かどうかを指定します

  • Mode: 操作が「Read」か「Write」かを示します

  • Supported: Snowparkがこの操作をサポートしているかどうかを示します

  • Line: 読み取りまたは書き込みが行われたファイルの行番号

  • SessionId: 各ツールセッションに割り当てられた一意の識別子

  • OptionalSettings: 要素に定義された追加パラメーターをリストします

  • CellId: ノートブックファイルの場合、特定のセル位置を識別子で指定(ノートブック以外のファイルの場合はnull)

  • ExecutionId: ツールを実行するたびに一意となる識別子

問題インベントリ

Issues.csv ファイルには、コードベースで発見されたすべての変換問題の詳細なレポートが含まれています。各問題について、以下の情報が得られます。

  • 問題を説明する記述

  • 問題が発生したファイル内の正確な場所

  • 問題タイプに固有のコード識別子

特定の問題に関するより詳細な情報については、ドキュメントの 問題の分析 セクションをご参照ください。

  • Code: ツールによって検出された各問題に割り当てられた一意の識別子

  • Description: 問題の詳細説明(該当する場合はSpark参照名を含む)

  • Category: 見つかった問題のタイプ。以下のいずれかです

    • 警告

    • 変換エラー

    • Parser Error

    • Helper

    • 変換

    • 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)

  • Arguments: このフィールドは常に空(null)です

  • LOC: セル内のコード行数

  • Size: セル内の文字合計数

  • SupportedStatus: セル内のすべての要素がサポートされているか(TRUE)、またはサポートされていない要素があるか(FALSE)を示します

  • ParsingResult: セルの解析に成功したか(「Successful」)、解析エラーがあったか(「Error」)を表示します

ノートブックサイズインベントリ

NotebookSizeInventory.csv ファイルは、ノートブックファイルにある各プログラミング言語のコード行の概要を提供します。

  • filename: スプレッドシートファイルの名前(FileId と同一)

  • ProjectId: ツールが実行されたルートディレクトリ名

  • FileId: Spark参照を含むファイルの相対パスとファイル名

  • Count: このファイル名を持つファイルの数

  • PythonLOC: ノートブックのセル内のPythonコード行数(通常のファイルの場合はゼロ)

  • ScalaLOC: ノートブックのセル内のScalaコード行数(通常のファイルの場合はゼロ)

  • SqlLOC: ノートブックセル内の SQL コード行数(通常のファイルの場合はゼロ)

  • Line: このフィールドは常に空です

  • SessionId: 各ツールセッションに割り当てられた一意の識別子

  • ExecutionId: 各ツールの実行に割り当てられた一意の識別子。

Pandas使用状況インベントリ

PandasUsagesInventory.csv ファイルには、スキャン中にPythonコードベースから検出されたすべてのPandas API 参照の包括的なリストが含まれています。

  • Element: pandas参照の一意の識別子

  • ProjectId: ツールが実行されたルートディレクトリ名

  • FileId: Spark参照を含むファイルへの相対パス

  • Count: 1行に出現する要素の数

  • 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: 1行に出現する要素の数

  • Alias: 要素のエイリアス(インポート要素にのみ適用されます)

  • Kind: 要素のカテゴリ(例: クラス、変数、関数、インポート)

  • Line: 要素が見つかったソースファイルの行番号

  • PackageName: 要素を含むパッケージ名

  • Supported: 参照がサポートされているどうかを示します(True/False)

  • Automated: ツールが要素を自動的に変換できるかどうかを示します(True/False)

  • Status: 要素のカテゴリ分類(Rename、Direct、Helper、Transformation、 WorkAround、 NotSupported、 NotDefined)

  • Statement: その要素が使用された実際のコード [NOTE: この列はテレメトリ経由では送信されません]

  • SessionId: 各ツール実行の一意の識別子

  • SnowConvertCoreVersion: ツールのコアプロセスのバージョン番号

  • SnowparkVersion: 特定のテクノロジとツールの実行に対して利用可能なSnowpark API バージョン

  • CellId: ノートブックファイルの場合は、要素が見つかったセルの数値位置

  • ExecutionId: この特定の SMA 実行に対する一意の識別子

SqlStatementsInventory.csv ファイルには、Spark SQL 要素で見つかった SQL キーワードのカウントが含まれています。

  • Element: SQL ステートメントを含むコード要素の名前

  • ProjectId: ツールが実行されたルートディレクトリ名

  • FileId: Spark参照を含むファイルへの相対パス

  • Count: 1行に出現する要素の数

  • 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: 1行に出現する要素の数

  • 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: この要素が1行に何回現れるかを表します

  • ExecutionId: 各ツール実行に割り当てられた一意の ID

  • LibraryName: 使用中のライブラリ名

  • HasLiteral: 要素がリテラル値を含むかどうかを示します

  • HasVariable: 要素に変数が含まれているかどうかを示します

  • HasFunction: 要素に関数呼び出しが含まれているかどうかを示します

  • ParsingStatus: 現在の解析状態(Success、Failed、またはPartial)

  • HasInterpolation: 要素に文字列の補間が含まれているかどうかを示します

  • CellId: ノートブックセルの識別子

  • Line: 要素が見つかった行番号

  • Column: 要素が見つかった列番号

サードパーティ使用状況インベントリ

ThirdPartyUsagesInventory.csv ファイルには以下が含まれます

  • Element: サードパーティ参照の一意の識別子

  • ProjectId: ツールが実行されたプロジェクトのルートディレクトリ名

  • FileId: Spark参照を含むファイルへの相対パス

  • Count: 1行に出現する要素の数

  • Alias: 要素に割り当てられた別の名前(該当する場合)

  • Kind: 要素のタイプ分類(変数、型、関数、クラス)

  • Line: 要素が見つかったソースファイルの行番号

  • PackageName: 完全なパッケージ名(Pythonでの ProjectId と FileId の組み合わせ)

  • Statement: 要素が使用された実際のコード [NOTE: テレメトリデータには含まれません]

  • SessionId: 各ツールセッションの一意の識別子

  • CellId: 要素が見つかったノートブックセルの識別子(ノートブックファイルでない場合はnull)

  • ExecutionId: 各ツール実行の一意の識別子

パッケージインベントリ

packagesInventory.csv ファイルには以下が含まれます

  • Package Name: 分析対象のパッケージ名。

  • Project Name: ツールが実行されたルートディレクトリに対応するプロジェクト名。

  • File Location: パッケージが見つかったファイルパスで、相対パスで表示されます。

  • Occurrence Count: このパッケージがコードの1行に出現する回数。

ツール実行の概要

tool_execution.csv ファイルには、Snowpark Migration Accelerator(SMA)ツールの現在の実行に関する重要な情報が含まれています。

  • ExecutionId: 各ツールの実行ごとに割り当てられた一意の識別子。

  • ToolName: 使用するツールの名前。PythonSnowConvert または SparkSnowConvert (Scalaの場合)のいずれかです。

  • Tool_Version: ソフトウェアのバージョン番号。

  • AssemblyName: コードプロセッサーの完全な名前(ToolName の詳細バージョン)。

  • LogFile: エラーまたは障害が発生したときにログファイルが生成されたかどうかを示します。

  • FinalResult: エラーや障害が発生した場合、ツールがどの時点で停止したかを示します。

  • ExceptionReport: エラーが発生したときにエラーレポートが生成されたかどうかを示します。

  • StartTime: ツールの実行開始日時。

  • EndTime: ツールの実行終了日時。

  • SystemName: ツールが実行されたたマシンのシリアル番号(トラブルシューティングとライセンスの検証にのみ使用)。