title: Can we store Spark-SQL-Kafka offset in MySQL table instead of HDFS or S3
body: <p>I have a simple Spark-SQL-Kafka program which reads from Kafka, and writes to HDFS.</p>
  
  <p>For check-pointing I have used HDFS and S3 in past, it works fine.</p>
  
  <p>Is there a way where I can use MySQL for check-pointing ? </p>
  
  <pre><code>.option("checkpointLocation", ConfigLoader.getValue("checkpointPath"))
  </code></pre>
  
  <p>How can we configure to MySQL table?</p>
  
  <pre class="lang-java prettyprint-override"><code>DataStreamReader kafkaDataStreamReader = sparkSession.readStream()
          .format("kafka")
          .option("kafka.bootstrap.servers", ConfigLoader.getValue("brokers"))
          .option("group.id", ConfigLoader.getValue("groupId"))
          .option("subscribe", ConfigLoader.getValue("topics"))
          .option("failOnDataLoss", false);
  Dataset&lt;Row&gt; rawDataSet = kafkaDataStreamReader.load();                         
  rawDataSet.createOrReplaceTempView("rawEventView");
  
  sqlCtx.sql("select * from rawEventView")
          .writeStream()
          .partitionBy(JavaConversions.asScalaBuffer(Arrays.asList(("date_year,date_month,date_day,date_hour,date_minute").split(","))))
          .format("csv")
          .option("header", "true")
          .option("compression","gzip")
          .option("delimiter", "~")
          .option("checkpointLocation", ConfigLoader.getValue("checkpointPath"))
          .option("path", ConfigLoader.getValue("recordsPath"))
          .outputMode(OutputMode.Append())
          .trigger(ProcessingTime.create(Integer.parseInt(ConfigLoader.getValue("kafkaProcessingTimeInSeconds")), TimeUnit.SECONDS))
          .start()
          .awaitTermination();
  </code></pre>