Snowpark Migration Accelerator: SQL statements¶
Tagged elements¶
SQL statements are tagged to monitor usage and consumption.
Statements |
HiveSQL |
SparkSQL |
SnowSQL |
|---|---|---|---|
CREATE TABLE |
SUPPORTED |
SUPPORTED |
FUNCTIONAL EQUIVALENT |
CREATE VIEW |
SUPPORTED |
SUPPORTED |
FUNCTIONAL EQUIVALENT |
CREATE FUNCTION |
NOT SUPPORTED |
SUPPORTED |
FUNCTIONAL EQUIVALENT |
ALTER TABLE |
SUPPORTED |
SUPPORTED |
FUNCTIONAL EQUIVALENT |
ALTER VIEW |
SUPPORTED |
SUPPORTED |
FUNCTIONAL EQUIVALENT |
Note
When a comment is marked as “FUNCTIONAL EQUIVALENT,” it means that only the comment’s transformation to Snowflake has been validated. Any other statements within the comment are not included in this status assessment.
Usages¶
The tool identifies and tags the following statements:
CREATE STATEMENTS¶
CREATE statements will include tags in two scenarios:
The SQL statement is missing the COMMENT property.
The SQL statement includes a
COMMENTproperty, but no value has been assigned to it.
If a SQL statement includes a comment, the comment will be preserved during the conversion process.
Example¶
Input (Apache SparkSQL)
Output (Snowflake SQL)
The formatting of the generated code may appear different from the source code due to formatting differences in the original file.
Create Table¶
Input code (SparkSQL)
Output code (Snowflake SQL)
CREATE VIEW¶
Source Code (HiveSQL)
Output code (Snowflake SQL)
CREATE FUNCTION¶
Input code (SparkSQL)
Output (Snowflake SQL)
ALTER STATEMENTS¶
ALTER statements include a tag when the comment property is empty. This occurs in two scenarios in SparkSQL:
When using
SET TBLPROPERTIESwith an empty commentWhen using
UNSET TBLPROPERTIES
Examples¶
SET TBLPROPERTIES (ALTER VIEW and ALTER TABLE)
Input (Apache Spark SQL)
Output (Snowflake SQL)
Output (Snowflake SQL)
UNSET TBLPROPERTIES (ALTER VIEW and ALTER TABLE)
Input (Apache Spark SQL)