Search code examples
databricksazure-databricks

PARSE_SYNTAX_ERROR: Syntax error at or near 'VACUUM'


I tried to VACUUM a delta table, but there is a Syntax error.

Here is the code:

%sql
set spark.databricks.delta.retentionDurationCheck.enabled = False
VACUUM test_deltatable

Solution

  • Executing your code gives the following error:

    set spark.databricks.delta.retentionDurationCheck.enabled = False
    VACUUM test_deltatable
    
    IllegalArgumentException: spark.databricks.delta.retentionDurationCheck.enabled should be Boolean, but was False
    

    As the Alex Ott correctly pointed, adding ; (semicolon) fixes it:

    set spark.databricks.delta.retentionDurationCheck.enabled = False;
    VACUUM test_deltatable
    

    enter image description here