SQL command FSCK is not found

BenzDriver
New Contributor II

Hello there,

I currently have the problem of deleted files still being in the transaction log when trying to call a delta table. What I found was this statement:

%sql
FSCK REPAIR TABLE table_name [DRY RUN]

But using it returned following error:

Error in SQL statement: ParseException: 
mismatched input 'FSCK' expecting {'(', 'CONVERT', 'COPY', 'OPTIMIZE', 'RESTORE', 'ADD', 'ALTER', 'ANALYZE', 'CACHE', 'CLEAR', 'COMMENT', 'COMMIT', 'CREATE', 'DELETE', 'DESC', 'DESCRIBE', 'DFS', 'DROP', 'EXPLAIN', 'EXPORT', 'FROM', 'GRANT', 'IMPORT', 'INSERT', 'LIST', 'LOAD', 'LOCK', 'MAP', 'MERGE', 'MSCK', 'REDUCE', 'REFRESH', 'REPLACE', 'RESET', 'REVOKE', 'ROLLBACK', 'SELECT', 'SET', 'SHOW', 'START', 'TABLE', 'TRUNCATE', 'UNCACHE', 'UNLOCK', 'UPDATE', 'USE', 'VALUES', 'WITH'}

Does anybody have an idea how I can fix this or what might cause this issue?

I'm running on Azure and use Databricks Runtime Version 9.1 (Apache Spark 3.1.2 and Scala 2.12)

RKNutalapati
Valued Contributor

Remove square brackets and try executing the command

%sql

FSCK REPAIR TABLE table_name DRY RUN

View solution in original post

Oh wow yes that was the issue. Thank you very much.