In my Spark appliction, I had to split the time and data and store them in separate column as follow:
val df5=df4.withColumn(\"read_date\",date_format(df4.col(\
There is no DataType in Spark to hold 'HH:mm:ss' values. Instead you can use hour(), minute() and second() functions to represent the values respectively.
All these functions return int types.
hour(string date) -- Returns the hour of the timestamp: hour('2009-07-30 12:58:59') = 12, hour('12:58:59') = 12.
minute(string date) -- Returns the minute of the timestamp.
second(string date) -- Returns the second of the timestamp.