I'm using Java-Spark.
I have the following table in Dataset
object:
<code> creationDate
15/06/2018 09:15:28
I make select to this column
<code>Dataset<Row> ds = dataframe.select(new Column("creationDate").as("mydate").cast("date"));
And I write it with:
<code>ds.write().mode(mode).save(hdfsDirectory);
Try also:
<code>ds.write().option("dateFormat","dd/MM/yyyy HH:mm:ss").mode(mode).save(hdfsDirectory);
But When I'm looking on my table the column mydate
is null.
How can I write my date into my Hive table? I know the default date format should be dd-MM-yyyy but my text is with dd/MM/yyyy format and I can't change it.
Any suggestions?
Thanks.