title: Spark2 Can't write dataframe to parquet hive table : HiveFileFormat`. It doesn't match the specified format `ParquetFileFormat`
body: <p>I'm trying to save dataframe in table hive.</p>
  
  <p>In spark 1.6 it's work but after migration to 2.2.0 it doesn't work anymore.</p>
  
  <p>Here's the code:</p>
  
  <pre><code>blocs
        .toDF()
        .repartition($"col1", $"col2", $"col3", $"col4")
        .write
        .format("parquet")
        .mode(saveMode)
        .partitionBy("col1", "col2", "col3", "col4")
        .saveAsTable("db".tbl)
  </code></pre>
  
  <p>The format of the existing table project_bsc_dhr.bloc_views is <code>HiveFileFormat</code>. It doesn't match the specified format <code>ParquetFileFormat</code>.;
  org.apache.spark.sql.AnalysisException: The format of the existing table project_bsc_dhr.bloc_views is <code>HiveFileFormat</code>. It doesn't match the specified format <code>ParquetFileFormat</code>.;</p>