SnowConvert AI - Problemas do RedShift

SSC-EWI-RS0002

A definição do “parâmetro de configuração” não é compatível com o Snowflake.

Gravidade

Medium

Descrição

The SET configuration parameter clause in Redshift procedures is not supported in Snowflake. Snowflake uses ALTER SESSION SET or session-level parameters instead. For more information, refer to CREATE PROCEDURE documentation.

Exemplo de código

Código de entrada:
Redshift
 CREATE OR REPLACE PROCEDURE procedure2(
    IN input_param INTEGER,
    OUT output_param NUMERIC
)
AS $$
BEGIN
    output_param := input_param * 1.7;
END;
$$
LANGUAGE plpgsql
SET enable_numeric_rounding to ON;
Código gerado:
Snowflake
 CREATE OR REPLACE PROCEDURE procedure2 (input_param INTEGER, output_param OUT NUMERIC)
RETURNS VARCHAR
LANGUAGE SQL
!!!RESOLVE EWI!!! /*** SSC-EWI-RS0002 - SET CONFIGURATION PARAMETER 'enable_numeric_rounding' IS NOT SUPPORTED IN SNOWFLAKE. ***/!!!
SET enable_numeric_rounding to ON
COMMENT = '{ "origin": "sf_sc", "name": "snowconvert", "version": {  "major": 0,  "minor": 0,  "patch": "0" }, "attributes": {  "component": "redshift",  "convertedOn": "07/16/2025",  "domain": "no-domain-provided" }}'
AS $$
BEGIN
    output_param := input_param * 1.7;
END;
$$;

Práticas recomendadas

  • Use ALTER SESSION SET: Snowflake provides ALTER SESSION SET to configure session-level parameters. Review whether the Redshift configuration parameter has an equivalent Snowflake session parameter.

  • Remove if unnecessary: Some Redshift configuration parameters (e.g., enable_numeric_rounding) have no Snowflake equivalent and may be safely removed if Snowflake’s default behavior meets your requirements.

  • Se precisar de mais suporte, envie um e-mail para snowconvert-support@snowflake.com

SSC-EWI-RS0003

A exibição sem vinculação de esquema não pode ser removida devido à ausência de referências.

Nota

This issue is deprecated and no longer generated by SnowConvert AI since version 2.2.6

Gravidade

Medium

Descrição

A documentação do RedShift para CREATE VIEW inclui uma cláusula opcional que especifica que a exibição específica não está vinculada aos objetos do banco de dados, tais como tabelas ou funções, nem aos objetos que está referenciando. A documentação também esclarece que, nos casos em que esta cláusula é utilizada, os objetos referenciados devem ser qualificados com um nome de esquema. Esta cláusula permite criar uma exibição e referenciar objetos que talvez ainda não existam. Sua existência será verificada uma vez que a exibição seja consultada, mas não em sua definição.

Entretanto, não há comando equivalente nem solução alternativa óbvia para implementar essa funcionalidade no Snowflake. Além disso, a documentação do Snowflake sugere que as exibições estão vinculadas a um esquema específico, assim como os objetos referenciados na exibição.

Se as referências vinculadas à exibição estiverem presentes no código de entrada, a instrução será removida sem problemas. Entretanto, se as referências necessárias estiverem ausentes, uma mensagem de aviso será adicionada para informar ao usuário que a instrução não pode ser removida devido às referências ausentes.

O SnowConvert AI executa análise somente no código de entrada e não leva em conta objetos já implantados no Snowflake. Portanto, a saída pode ter alguns problemas ao apontar para referências ausentes. Se as referências já estiverem presentes no banco de dados do Snowflake, o usuário poderá remover a instrução com segurança sem problemas.

Exemplos de código

Código de entrada:
Redshift
 CREATE VIEW myView AS SELECT col1 FROM public.missingTable
WITH NO SCHEMA BINDING;
Código gerado:
Snowflake
 --** SSC-FDM-0007 - MISSING DEPENDENT OBJECT "public.missingTable" **
CREATE VIEW myView
COMMENT = '{ "origin": "sf_sc", "name": "snowconvert", "version": {  "major": 0,  "minor": 0,  "patch": "0" }, "attributes": {  "component": "redshift",  "convertedOn": "09/17/2024" }}'
AS SELECT col1 FROM
public.missingTable
!!!RESOLVE EWI!!! /*** SSC-EWI-RS0003 - WITH NO SCHEMA BINDING STATEMENT CAN NOT BE REMOVED DUE TO MISSING REFERENCES. ***/!!!
WITH NO SCHEMA BINDING;

Práticas recomendadas

  • Para resolver este problema, é sugerida a adição das referências ausentes ao código de entrada. Se o objeto já estiver implementado no banco de dados do Snowflake, a instrução poderá ser removida sem problemas.

  • Se precisar de mais suporte, envie um e-mail para snowconvert-support@snowflake.com

SSC-EWI-RS0004

Tipo de dados HLLSKETCH incompatível com o Snowflake.

Gravidade

High

Descrição

Este problema de conversão é adicionado porque o tipo de dados HLLSKETCH não é compatível com o Snowflake.

Exemplo de código

Código de entrada:
 CREATE TABLE table1
(
    col_hllsketch HLLSKETCH
);
Código gerado:
 CREATE TABLE table1
(
    col_hllsketch HLLSKETCH !!!RESOLVE EWI!!! /*** SSC-EWI-RS0004 - HLLSKETCH DATA TYPE NOT SUPPORTED IN SNOWFLAKE. ***/!!!
)
COMMENT = '{ "origin": "sf_sc", "name": "snowconvert", "version": {  "major": 0,  "minor": 0,  "patch": "0" }, "attributes": {  "component": "redshift",  "convertedOn": "09/17/2024" }}';

Práticas recomendadas

SSC-EWI-RS0005

Pending SnowConvert AI translation for column aliases in the PIVOT/UNPIVOT IN clause.

Gravidade

High

Descrição

Pending SnowConvert AI translation for column aliases in the PIVOT/UNPIVOT IN clause. Snowflake now supports the AS clause for specifying column aliases in PIVOT and UNPIVOT operations (added October 2025). This is a SnowConvert AI limitation, not a Snowflake platform limitation.

Exemplo de código

Código de entrada:
Redshift
 SELECT *
FROM count_by_color UNPIVOT (
    cnt FOR color IN (red AS r, green AS g, blue AS b)
);
Código gerado:
Snowflake
 SELECT *
FROM
    count_by_color UNPIVOT (
    cnt FOR color IN (red
                          !!!RESOLVE EWI!!! /*** SSC-EWI-RS0005 - PENDING SNOWCONVERT AI TRANSLATION FOR COLUMN ALIASES IN THE PIVOT/UNPIVOT IN CLAUSE. ***/!!! AS r, green
                                                                                                                                                                              !!!RESOLVE EWI!!! /*** SSC-EWI-RS0005 - PENDING SNOWCONVERT AI TRANSLATION FOR COLUMN ALIASES IN THE PIVOT/UNPIVOT IN CLAUSE. ***/!!! AS g, blue
                                                                                                                                                                                                                                                                                                                                 !!!RESOLVE EWI!!! /*** SSC-EWI-RS0005 - PENDING SNOWCONVERT AI TRANSLATION FOR COLUMN ALIASES IN THE PIVOT/UNPIVOT IN CLAUSE. ***/!!! AS b)
);

Práticas recomendadas

  • Use native Snowflake support: Snowflake now supports the AS clause for column aliases in PIVOT/UNPIVOT IN clauses. Remove the EWI marker and use the aliases directly:

 SELECT *
FROM count_by_color UNPIVOT (
    cnt FOR color IN (red AS r, green AS g, blue AS b)
);

SSC-EWI-RS0006

The behavior of the SUBSTRING function on binary data differs between Redshift and Snowflake.

Gravidade

Medium

Descrição

The behavior of the SUBSTRING function on binary data differs between Redshift and Snowflake. In Redshift, SUBSTRING on VARBYTE operates on raw bytes. In Snowflake, SUBSTRING on BINARY operates on hex-encoded character pairs, so the same positional arguments may return different results.

Exemplo de código

Código de entrada:
Redshift
 SELECT SUBSTRING('12345'::varbyte, 2, 4) AS substring_binary;
SELECT SUBSTRING('abc'::varbyte, 2, 4) AS substring_binary;
Código gerado:
Snowflake
 SELECT SUBSTRING('12345':: BINARY, 2, 4) !!!RESOLVE EWI!!! /*** SSC-EWI-RS0006 - THE BEHAVIOR OF THE SUBSTRING FUNCTION ON BINARY DATA DIFFERS BETWEEN REDSHIFT AND SNOWFLAKE. ***/!!! AS substring_binary;
SELECT SUBSTRING('abc':: BINARY, 2, 4) !!!RESOLVE EWI!!! /*** SSC-EWI-RS0006 - THE BEHAVIOR OF THE SUBSTRING FUNCTION ON BINARY DATA DIFFERS BETWEEN REDSHIFT AND SNOWFLAKE. ***/!!! AS substring_binary;

Práticas recomendadas

  • Verify binary output: Compare SUBSTRING results on binary columns between Redshift and Snowflake to confirm correctness after migration.

  • Adjust offsets: Because Snowflake’s BINARY type uses hex encoding, you may need to multiply position and length arguments by 2 to achieve equivalent byte-level extraction.

  • Se precisar de mais suporte, envie um e-mail para snowconvert-support@snowflake.com

SSC-EWI-RS0007

O literal de data não é compatível com o Snowflake.

Gravidade

High

Descrição

Some DATE, TIME, or TIMESTAMP literal formats used in Redshift (e.g., '2000-Jan-31', 'Jan-31-2000') are not recognized by Snowflake. These literals must be rewritten to a supported Snowflake date format or converted using TO_DATE with an explicit format string.

Exemplo de código

Código de entrada:
Redshift
 select datediff(century, '2000-Jan-31', 'Jan-31-2000');
Código gerado:
Snowflake
  select
 DATEDIFF(YEAR,
                !!!RESOLVE EWI!!! /*** SSC-EWI-RS0007 - '2000-Jan-31' DATE LITERAL IS NOT SUPPORTED IN SNOWFLAKE. ***/!!!
                '2000-Jan-31',
                               !!!RESOLVE EWI!!! /*** SSC-EWI-RS0007 - 'Jan-31-2000' DATE LITERAL IS NOT SUPPORTED IN SNOWFLAKE. ***/!!!
                               'Jan-31-2000') / 100;

Práticas recomendadas

  • Use ISO 8601 format: Rewrite date literals to 'YYYY-MM-DD' format, which is universally supported in Snowflake.

  • Use TO_DATE with format string: If the original format must be preserved, use TO_DATE('Jan-31-2000', 'MON-DD-YYYY') to explicitly parse the date.

  • Se precisar de mais suporte, envie um e-mail para snowconvert-support@snowflake.com

SSC-EWI-RS0008

Delete statement cannot be used on dynamic tables in Snowflake.

Gravidade

High

Descrição

In Redshift, you can apply the DELETE statement to materialized views used for streaming ingestion. In Snowflake, materialized views are transformed into dynamic tables, and the DELETE statement cannot be used on dynamic tables.

Exemplo de código

Código de entrada:
Redshift
 CREATE MATERIALIZED VIEW mv AS
SELECT id, name, department_id FROM employees WHERE department_id = 101;

DELETE FROM mv
WHERE id = 2;
Código gerado:
Snowflake
 CREATE DYNAMIC TABLE mv
--** SSC-FDM-0031 - DYNAMIC TABLE REQUIRED PARAMETERS SET BY DEFAULT **
TARGET_LAG='1 day'
WAREHOUSE=UPDATE_DUMMY_WAREHOUSE
COMMENT = '{ "origin": "sf_sc", "name": "snowconvert", "version": {  "major": 0,  "minor": 0,  "patch": "0" }, "attributes": {  "component": "redshift",  "convertedOn": "03/03/2025",  "domain": "test" }}'
AS
SELECT id, name, department_id FROM
employees
WHERE department_id = 101;


!!!RESOLVE EWI!!! /*** SSC-EWI-RS0008 - MATERIALIZED VIEW IS TRANSFORMED INTO A DYNAMIC TABLE, AND THE DELETE STATEMENT CANNOT BE USED ON DYNAMIC TABLES IN SNOWFLAKE. ***/!!!
DELETE FROM
mv
WHERE id = 2;

Práticas recomendadas

  • Replace the dynamic table definition: Because dynamic tables cannot be directly deleted from, you can achieve the same result by altering the dynamic table’s underlying query to exclude the rows you want to remove.

  • Use a regular table: If row-level DML (INSERT, UPDATE, DELETE) is required, consider using a regular table with a scheduled task instead of a dynamic table.

  • Se precisar de mais suporte, envie um e-mail para snowconvert-support@snowflake.com

SSC-EWI-RS0009

Source table semantic information not found in the code provided to SnowConvert AI.

Gravidade

Low

Descrição

Snowflake does not support the MERGE ... REMOVE DUPLICATES clause. SnowConvert AI generates a workaround that includes an INSERT WHEN NOT MATCHED clause, which requires knowledge of the source table’s columns. If the source table definition was not included in the code provided to SnowConvert AI, the column list cannot be generated and must be added manually.

Exemplo de código

Código de entrada:
Redshift
 MERGE INTO target USING source ON target.id = source.id REMOVE DUPLICATES;
Código gerado:
Snowflake
 CREATE TEMPORARY TABLE source_duplicates AS
SELECT DISTINCT
source.*
FROM
source
INNER JOIN
target
ON target.id = source.id;
!!!RESOLVE EWI!!! /*** SSC-EWI-RS0009 - SEMANTIC INFORMATION NOT FOUND FOR THE SOURCE TABLE IN THE CODE PROVIDED TO SNOWCONVERT AI. COLUMNS TO BE INSERTED MAY BE ADDED MANUALLY. ***/!!!
--** SSC-FDM-RS0005 - REDSHIFT MERGE STATEMENT REJECTS DUPLICATE SOURCE ROWS. SNOWFLAKE ALLOWS DUPLICATES, WHICH MAY PRODUCE NON-DETERMINISTIC RESULTS. **
MERGE INTO target
USING source ON target.id = source.id
WHEN MATCHED THEN
DELETE
WHEN NOT MATCHED THEN
INSERT
VALUES ();
INSERT INTO target
SELECT
*
FROM
source_duplicates;
DROP TABLE IF EXISTS source_duplicates CASCADE;

Práticas recomendadas

  • Include all source DDL: Provide the source table’s CREATE TABLE statement in the input code so SnowConvert AI can resolve columns automatically.

  • Add columns manually: If the source table definition is unavailable, fill in the INSERT ... VALUES () clause with the correct column list from your Redshift catalog.

  • Se precisar de mais suporte, envie um e-mail para snowconvert-support@snowflake.com

SSC-EWI-RS0010

Top-level procedure call with out parameters is not supported in Snowflake.

Gravidade

Low

Descrição

Redshift allows top-level CALL statements to invoke procedures with OUT parameters without declaring a variable to receive the output. Snowflake requires that OUT parameters be assigned to a variable, which is only possible inside a stored procedure or anonymous block.

Exemplo de código

Código de entrada:
Redshift
 CREATE OR REPLACE PROCEDURE get_total_sales_by_product(
    IN p_product_name VARCHAR(100),
    OUT p_total_sales DECIMAL(18, 2)
)
AS $$
BEGIN
    NULL;
END;
$$ LANGUAGE plpgsql;

CALL get_total_sales_by_product('Laptop');
Código gerado:
Snowflake
 CREATE OR REPLACE PROCEDURE get_total_sales_by_product (p_product_name VARCHAR(100), p_total_sales OUT DECIMAL(18, 2))
RETURNS VARCHAR
LANGUAGE SQL
COMMENT = '{ "origin": "sf_sc", "name": "snowconvert", "version": {  "major": 0,  "minor": 0,  "patch": "0" }, "attributes": {  "component": "redshift",  "convertedOn": "07/10/2025",  "domain": "no-domain-provided" }}'
AS $$
BEGIN
NULL;
END;
$$;
!!!RESOLVE EWI!!! /*** SSC-EWI-RS0010 - TOP-LEVEL PROCEDURE CALL WITH OUT PARAMETERS IS NOT SUPPORTED IN SNOWFLAKE. ***/!!!
CALL get_total_sales_by_product('Laptop');

Práticas recomendadas

  • Mova a chamada em um bloco anônimo e declare uma variável a ser passada como parâmetro de saída.

  • Se precisar de mais suporte, envie um e-mail para snowconvert-support@snowflake.com