title: How to make MSCK REPAIR TABLE execute automatically in AWS Athena
body: <p>I have a Spark batch job which is executed hourly. Each run generates and stores new data in <code>S3</code> with the directory naming pattern <code>DATA/YEAR=?/MONTH=?/DATE=?/datafile</code>.</p>
  <p>After uploading the data to <code>S3</code>, I want to investigate it using <code>Athena</code>. Also, I would like to visualize them in <code>QuickSight</code> by connecting to Athena as a data source.</p>
  <p>The problem is that after each run of my Spark batch, the newly generated data stored in <code>S3</code> will not be discovered by Athena, unless I manually run the query <code>MSCK REPAIR TABLE</code>.</p>
  <p>Is there a way to make Athena update the data automatically, so that I can create a fully automatic data visualization pipeline?</p>