GitHub Actions with Liquibase on Snowflake EOF error

All,

I’m looking for help to resolve an error doing deployments with GitHub Actions on Snowflake using the Liquibase docker on linux. (version 4.21.1 #9070 built at 2023-04-13 20:56+0000)

There are a couple of scenarios that I’ve hit, one I found a workaround for the other I haven’t been able to resolve.

There appear to be some code structures that cause an ‘EOF’ error to happen on snowflake with SQL based stored procedures.

ERROR: Reason: liquibase.exception.DatabaseException: SQL compilation error: syntax error line 38 at position 53 unexpected ‘EOF’

Be aware if I run the procedure create operations directly in Snowflake… the error does not happen and the procedures are created and will execute successfully if called in Snowflake. So I am sure the procedures meet Snowflake SnowSQL requirements.

The first… I’ve worked around is as follows. When a variable declaration is between the AS and BEGIN statements in the procedure definition it throws the listed EOF error
–BREAKS (EOF error)

proc create definition here
AS
DECLARE
result boolean;
header_line varchar;
sql_command varchar;
BEGIN
remainder of procedure here

However when I move the variables into the body
–WORKS

proc create definition here
AS
BEGIN
– Liquibase workaround: Move Declare statements into main statements
LET result boolean;
LET header_line varchar;
LET sql_command varchar;
remainder of procedure here

I also get the same error message on other constructs where I have been unable to find a workaround or reason. Specifically when using the following CTE .

with
schema_compare as (
    select A.column_name as ACN, a.ordinal_position  as AOP, B.column_name as BCN, b.ordinal_position as BOP
    from table_schema as A 
    full outer join file_schema as B on A.column_name = B.COLUMN_name and A.ordinal_position = B.ordinal_position
)
select CASE WHEN count(*) = 0 THEN TRUE ELSE FALSE END INTO :result from schema_compare where ACN is null or BCN is null;

Note: I know that isn’t the most efficient CTE… I’ve also tried several code blocks that do the same thing and all of them appear to have the same issue.

I tried without the CTE and just a query… I tried a Sub-Query… I tried a single row count query and a separate IF block.

If anyone can provide me with guidance on how to resolve this issue it would be very much appriciated.

Thanks,
Robert

I had a chat with Snowflake and was sent the following article reference that helped with similar error information I ran into using SnowSQL, but found that it still did not resolve my trouble with Liquibase.

https://docs.snowflake.com/en/developer-guide/snowflake-scripting/running-examples

Found a fix… by changing the end delimiter the issue was able to be resolved.
Specifically, I used endDelimiter:“”