Snowpark Migration Accelerator:简介

Overview of the Snowpark Migration Accelerator

The Snowpark Migration Accelerator (SMA), formerly SnowConvert for Spark, helps developers convert code from various platforms to Snowflake. It uses a proven migration framework with 30 years of development to analyze code that contains Spark API calls. The tool creates an Abstract Syntax Tree (AST) and Symbol Table to build a detailed model of how the code works. This model helps convert the original code into equivalent Snowflake code automatically, maintaining the same functionality as the source code.

SMA 简要示意图

Snowpark Migration Accelerator (SMA) 创建详细的模型来捕捉您的源代码的含义和目的,从而分析您的源代码。与仅搜索和替换文本或匹配模式的基本工具相比,这种方式让 SMA 能更深入地了解您的代码的工作原理。

SMA 会扫描您的源代码和笔记本文件,以查找所有 Spark API 调用。然后会尽可能将这些 Spark API 调用转换为与之匹配的 Snowpark API 函数。

Assessment and Conversion

Snowpark Migration Accelerator (SMA) 具有两种运行模式:

  1. Assessment (or Qualification) - A free analysis tool that evaluates your code before conversion

  2. Conversion - Transforms your code to Snowpark

强烈建议在开始任何代码转换之前先运行评估模式。

评估模式

Assessment mode helps users find and analyze Spark API usage in their code. SMA scans the source code and builds a semantic model using our specialized framework. This model helps SMA understand how the code works and what it does. As a result, SMA can generate detailed and accurate reports about the code's components.

SMA 会分析您的代码,帮您规划迁移过程。它可以识别 Spark API 依赖项,并评估您的代码迁移就绪情况。评估完成后,您可以继续转换代码。

For more information about how SMA assesses your code, please see the Assessment section of the SMA User Guide.

转换模式

在转换阶段,SMA 使用评估阶段创建的语义模型,自动生成与 Snowflake 兼容的代码。该工具会尽可能使用等效 Snowpark API 调用替换 Spark API 调用。无法直接转换时,SMA 会在输出代码中添加详细注释,解释无法转换某些元素的原因,并为手动转换提供有用的上下文。

概要

本节提供有关 Snowpark Migration Accelerator (SMA) 的全面指导,涵盖如下关键领域:

For assistance or questions, please Contact Us.

我们诚邀您开始探索 Snowpark Migration Accelerator (SMA) 的特性和功能。