title: PySpark - Saving Hive Table - org.apache.spark.SparkException: Cannot recognize hive type string
body: <p>I am saving a spark dataframe to a hive table. The spark dataframe is a nested json data structure. I am able to save the dataframe as files but it fails at the point where it creates a hive table on top of it saying
   <code>org.apache.spark.SparkException: Cannot recognize hive type string</code></p>
  
  <p>I cannot create a hive table schema first and then insert into it since the data frame consists of a couple hundreds of nested columns. </p>
  
  <p>So I am saving it as:</p>
  
  <pre><code>df.write.partitionBy("dt","file_dt").saveAsTable("df")
  </code></pre>
  
  <p>I am not able to debug what the issue this.</p>