This is the date value I want to use when I convert RDD to Dataframe.
Sun Jul 31 10:21:53 PDT 2016
This schema "DataTypes.DateType" throws an error.
java.util.Date is not a valid external type for schema of date
So I want to prepare RDD in advance in such a way that above schema can work. How can I correct the date format to work in conversion to dataframe?
//Schema for data frame val schema = StructType( StructField("lotStartDate", DateType, false) :: StructField("pm", StringType, false) :: StructField("wc", LongType, false) :: StructField("ri", StringType, false) :: Nil) // rowrdd : [Sun Jul 31 10:21:53 PDT 2016,"PM",11,"ABC"] val df = spark.createDataFrame(rddRow,schema)