cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
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.

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group