title: Save Spark dataframe as dynamic partitioned table in Hive
body: <p>I have a sample application working to read from csv files into a dataframe. The dataframe can be stored to a Hive table in parquet format using the method 
  <em><code>df.saveAsTable(tablename,mode)</code></em>. </p>
  
  <p>The above code works fine, but I have so much data for each day that i want to dynamic partition the hive table based on the creationdate(column in the table).</p>
  
  <p>is there any way to dynamic partition the dataframe and store it to hive warehouse. Want to refrain from Hard-coding the insert statement using <em><code>hivesqlcontext.sql(insert into table partittioin by(date)....)</code></em>.</p>
  
  <p>Question can be considered as an extension to :<a href="https://stackoverflow.com/questions/30664008/how-to-load-dataframe-directly-to-hive-in-spark">How to save DataFrame directly to Hive?</a></p>
  
  <p>any help is much appreciated.</p>