I have a simple schema with a date and an int. I want to use date_add to add the int to the date.
scala> val ds1 = spark.read.option("inferSchema",true).csv("samp.csv")
ds1.printSchema();
root
|-- _c0: timestamp (nullable = true)
|-- _c1: integer (nullable = true)
I cannot get the first param to date_add work...please help!
scala> val ds2 = ds1.map ( x => date_add(x.getAs[timestamp]("_c0"), x.getAs[Int]("_c1")))
<console>:28: error: not found: type timestamp
scala> val ds2 = ds1.map ( x => date_add(x.getAs[Column]("_c0"), x.getAs[Int] ("_c1")))
<console>:28: error: not found: type Column