cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
cancel
Showing results for 
Search instead for 
Did you mean: 

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)

1 ACCEPTED SOLUTION

Accepted Solutions

RKNutalapati
Valued Contributor

Remove square brackets and try executing the command

%sql

FSCK REPAIR TABLE table_name DRY RUN

View solution in original post

2 REPLIES 2

RKNutalapati
Valued Contributor

Remove square brackets and try executing the command

%sql

FSCK REPAIR TABLE table_name DRY RUN

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

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.