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.

Join 100K+ Data Experts: Register Now & Grow with Us!

Excited to expand your horizons with us? Click here to Register and begin your journey to success!

Already a member? Login and join your local regional user group! If there isn’t one near you, fill out this form and we’ll create one for you to join!