Re: Converting String to Datetime using map

2016-03-24 Thread Mich Talebzadeh
Thanks. Tried this scala> val a = df.filter(col("Total") > "").map(p => Invoices(p(0).toString, p(1).toString.TO_DATE(FROM_UNIXTIME(UNIX_TIMESTAMP(p(1),"dd/MM/"),"-MM-dd")), p(2).toString.substring(1).replace(",", "").toDouble, p(3).toString.substring(1).replace(",", "").toDouble, p(4).t

Re: Converting String to Datetime using map

2016-03-24 Thread Alexander Krasnukhin
You can invoke exactly the same functions on scala side as well i.e. http://spark.apache.org/docs/latest/api/scala/index.html#org.apache.spark.sql.functions$ Have you tried them? On Thu, Mar 24, 2016 at 10:29 PM, Mich Talebzadeh wrote: > > Hi, > > Read a CSV in with the following schema > > sca