title: Write Partition with Date column Java-Spark
body: <p>I'm Using Java-Spark.</p>
  
  <p>I'm trying to write to Hive table by date partition column,
  What I'm trying is:</p>
  
  <pre><code>Dataset&lt;Row&gt; ds = dataframe.select(cols).withColumn("load_date", function.lit("08.07.2018").cast("date"));
  ds.write().mode(mode).partitionBy("load_date").save(hdfsDirectory);
  </code></pre>
  
  <p>After I'm running the lines below I see in hdfs the following directory:</p>
  
  <pre><code>/load_date=__HIVE_DEFAULT_PARTITION__
  </code></pre>
  
  <p>That meaning on null value.</p>
  
  <p>So how can I write partition by date?</p>
  
  <p>Thanks.</p>