I am trying to deploy a Databricks SQL stored procedure using Flyway, but I am encountering a parsing error during migration execution.
The same procedure runs successfully when executed directly in the Databricks SQL editor, but fails when executed via Flyway.
Error Message:
[PARSE_SYNTAX_ERROR] Syntax error at or near end of input.
SQLSTATE: 42601
The error points to the end of a MERGE statement inside the procedure, suggesting that the statement is not being fully parsed.
What the procedure contains:
CREATE OR REPLACE PROCEDURE
LANGUAGE SQL
- A
MERGE INTO ... USING (...) statement
WHEN MATCHED THEN UPDATE
- Ends with
END;
Suspected Cause:
It appears that Flyway may be splitting the SQL script at semicolons (;) before sending it to Databricks, causing the procedure body (especially the MERGE statement) to be incomplete.
Questions:
- Does Flyway require a custom delimiter when executing multi-statement Databricks SQL procedures?
- Is there a recommended way to deploy Databricks SQL procedures via Flyway without encountering statement splitting issues?
- Are there known limitations when using
MERGE inside SQL procedures with Flyway?
I am trying to deploy a Databricks SQL stored procedure using Flyway, but I am encountering a parsing error during migration execution.
The same procedure runs successfully when executed directly in the Databricks SQL editor, but fails when executed via Flyway.
Error Message:
The error points to the end of a
MERGEstatement inside the procedure, suggesting that the statement is not being fully parsed.What the procedure contains:
CREATE OR REPLACE PROCEDURELANGUAGE SQLMERGE INTO ... USING (...)statementWHEN MATCHED THEN UPDATEEND;Suspected Cause:
It appears that Flyway may be splitting the SQL script at semicolons (
;) before sending it to Databricks, causing the procedure body (especially theMERGEstatement) to be incomplete.Questions:
MERGEinside SQL procedures with Flyway?