3

When trying to refresh the partitions in a AWS Athena/Glue table I am getting this error

line 1:1: mismatched input 'MSCK'. Expecting: 'ALTER', 'ANALYZE', 'CALL', 'COMMIT', 'CREATE', 'DEALLOCATE', 'DELETE', 'DESC', 'DESCRIBE', 'DROP', 'EXECUTE', 'EXPLAIN', 'GRANT', 'INSERT', 'PREPARE', 'RESET', 'REVOKE', 'ROLLBACK', 'SET', 'SHOW', 'START', 'UNLOAD', 'UPDATE', 'USE',

the command I execute is

MSCK REPAIR TABLE "table_name"

It was working a week ago. I believe there was an update but I cannot find the new/proper way to add new partitions

  • @JohnRotenstein, yes. I fixed the command. I first got the error when running from a Lambda and I have confirmed it fails running from AWS Console. From the error it seems the REPAIR option no longer exists – Eduardo Rodrigues Apr 07 '22 at 07:39
  • 2
    It worked fine for me, then then I managed to reproduce your error by including the quotes. You need to **remove the quotes from around the table name**. – John Rotenstein Apr 07 '22 at 07:55
  • that worked, such a poor error message – Eduardo Rodrigues Apr 07 '22 at 10:42

2 Answers2

4

I had the same problem. The quotation marks are probably wrong. Try

MSCK REPAIR TABLE `table_name`;
0x4a6f4672
  • 27,297
  • 17
  • 103
  • 140
0

In my case, the table was attached to a Glue Crawler... So it was just to run the Crawler again!