MSC-BQ0014

SnowConvert was unable to generate correct return table clause.

This is a deprecated version of the SnowConvert documentation, please visit the official site HERE.

Severity

High

Description

Snowflake requires a valid RETURNS TABLE clause for CREATE TABLE FUNCTION statements. SnowConvert has to build a new one from the ground up. To do this, an analysis is made to the CREATE TABLE FUNCTION query in order to properly infer the types of the columns of the resulting table, however there may be scenarios where Snowconvert currently has a limitation to be able to build the return clause properly.

These scenarios will be considered in the future, but in the meantime this error will be added.

Code Example

BigQuery

CREATE OR REPLACE TABLE FUNCTION test.function1 ()
AS
WITH groceries AS
  (SELECT "milk" AS dairy,
   "eggs" AS protein,
   "bread" AS grain)
SELECT g.*
FROM groceries AS g;

Snowflake

CREATE OR REPLACE FUNCTION test.function1 ()
----** MSC-ERROR - MSC-BQ0014 - SNOWCONVERT WAS UNABLE TO GENERATE CORRECT RETURNS TABLE CLAUSE. **
--RETURNS TABLE (
--)
AS
  $$
      WITH groceries AS
        (SELECT
          'milk' AS dairy,
          'eggs' AS protein,
          'bread' AS grain)
      SELECT g.*
      FROM
        groceries AS g
  $$;

Recommendations

Last updated