My requirement is as below
Joined two data frames as below:
var c = a.join(b,keys,"fullouter")
c.printSchema() as below:
|-- add: string (nullable = true)
|-- sub: string (nullable = true)
|-- delete: string (nullable = true)
|-- mul: long (nullable = true)
|-- ADD: string (nullable = true)
|-- SUB: string (nullable = true)
|-- DELETE: string (nullable = true)
|-- MUL: long (nullable = true)
It's good until here.
Now i am doing a withcolumn when condition as below
val d = c.withColumn("column", when(c("a.add") === c("b.ADD"),
"Neardata"))
error as below:
Exception in thread "main" org.apache.spark.sql.AnalysisException:
Cannot resolve column name "a.add"
I tried as below also
val d = c.withColumn("column", when(col("a.add") === col("b.ADD"), "Neardata"))
Again error.
Please suggest.