Welcome to the Simplilearn Community

Want to join the rest of our members? Sign up right away!

Sign Up

Convert String to timestamp, date, month and year in spark/scala

please help me to convert - from String to timestamp, date, month and year in spark/scala

order_purchase_timestamp column datatype is string in table.

the below statement does not work - please help
val totalSales = olistDF.groupBy(to_date(col("order_purchase_timestamp"),"MM-dd-yyyy")).agg(sum("order_products_value")).show
 
Last edited:
Top