I am converting string to datetime field using joda.time.Datetime libraries but it throws unsupported exception Here is main class code:
//create new var with
Scala spark schema doesnot support datetime explicitly. You can explore other options. They are:
Convert datetime to millis and you can maintain in Long format .
Convert datetime to unixtime (java format) https://stackoverflow.com/a/44957376/9083843
Convert datetime to string. you can change back to joda datetime at any moment using DateTime.parse("stringdatetime")
If you still want to maintain in joda datetime in scala schema then you can convert your dataframe to sequence
dataframe.rdd.map(r =>DateTime.parse(r(0).toString())).collect().toSeq