I have a dataframe with one DateTime column and many other columns.
All I wanted to do is parse this DateTime column value and check if the format is \"yyyy-MM
\"yyyy-MM
Use option("dateFormat", "MM/dd/yyyy") to validate date field in dataframe.It will discard the invalid rows.
val df=spark.read.format("csv").option("header", "false"). option("dateFormat", "MM/dd/yyyy"). schema(schema).load("D:/cca175/data/emp.csv")