SnowConvert AI - Azure Synapse¶
What is SnowConvert AI for Azure Synapse?¶
SnowConvert AI is a software that understands Azure Synapse scripts and converts this source code into functionally equivalent Snowflake code.
변환 유형¶
Specifically, SnowConvert AI for Azure Synapse performs the following conversions:
Azure Synapse to Snowflake SQL¶
SnowConvert AI understands the Azure Synapse source code and converts the Data Definition Language (DDL), Data Manipulation Language (DML), and functions in the source code to the corresponding SQL in the target: Snowflake.
샘플 코드¶
Azure Synapse 기본 입력 코드:
CREATE TABLE Persons (
PersonID int,
LastName varchar(255),
FirstName varchar(255),
Address varchar(255),
City varchar(255)
);
Snowflake SQL 출력 코드:
CREATE OR REPLACE TABLE Persons (
PersonID INT,
LastName VARCHAR(255),
FirstName VARCHAR(255),
Address VARCHAR(255),
City VARCHAR(255)
)
COMMENT = '{"origin":"sf_sc","name":"snowconvert","version":{"major":1, "minor":0},{"attributes":{"component":"azure synapse"}}'
;
보시다시피 대부분의 구조는 동일하게 유지됩니다. 예를 들어, 데이터 타입을 변환해야 하는 경우가 있습니다.
Snowflake SQL 에 내장된 JavaScript 로의 Azure Synapse 저장 프로시저 ¶
SnowConvert AI takes Azure Synapse stored procedures and converts them to JavaScript embedded into Snowflake SQL. Azure Synapse’s CREATE PROCEDURE is replaced by Snowflake’s CREATE OR REPLACE PROCEDURE. JavaScript is called as a scripting language, and all of the inner statements are converted to JavaScript.
샘플 코드¶
Azure Synapse 기본 저장 프로시저:
CREATE PROCEDURE SelectAllCustomers
AS
SELECT * FROM Customers
GO;
Snowflake SQL 출력 코드, 내장 JavaScript 포함:
-- Additional Params: -t JavaScript
CREATE OR REPLACE PROCEDURE SelectAllCustomers ()
RETURNS STRING
LANGUAGE JAVASCRIPT
COMMENT = '{"origin":"sf_sc","name":"snowconvert","version":{"major":1, "minor":0},"attributes":{"component":"transact"}}'
EXECUTE AS CALLER
AS
$$
// REGION SnowConvert AI Helpers Code
// END REGION
EXEC(`SELECT
*
FROM
Customers`);
$$;
!!!RESOLVE EWI!!! /*** SSC-EWI-0040 - THE STATEMENT IS NOT SUPPORTED IN SNOWFLAKE ***/!!!
;
JavaScript 코드를 생성할 때 프로시저의 내용을 쉽게 변환하기 위해 _helper_로 추가되는 코드가 있는데, 이는 프로시저의 내용을 쉽게 변환하기 위해 필수입니다.
변환된 코드에서 어떤 일이 발생하는지 확인할 수 있도록 관련 코드와 함께 경고가 표시될 수 있습니다. (문제 및 문제 해결 참조)
SnowConvert AI Terminology¶
이러한 코드 변환의 마법에 빠져들기 전에 몇 가지 용어/정의에 대한 설명서를 통해 그 의미를 이해할 수 있도록 몇 가지 용어를 소개합니다.
SQL (구조화된 쿼리 언어): 대부분의 최신 데이터베이스 아키텍처에서 데이터를 저장, 조작, 검색하기 위한 표준 언어입니다.
SnowConvert AI: the software that converts securely and automatically your Azure Synapse files to the Snowflake cloud data platform.
Conversion rule or transformation rule: rules that allow SnowConvert AI to convert from a portion of source code to the expected target code.
Parse: parse or parsing is an initial process done by SnowConvert AI to understand the source code and build up an internal data structure required for executing the conversion rules.
On the next few pages, you’ll learn more about the kind of conversions that SnowConvert AI for SQL Server is capable of. If you’re ready to get started, visit the Getting Started page in this documentation.