While running a Spark SQL, I am getting mismatched input 'from' expecting <EOF> error.
I checked the common syntax errors which can occur but didn't find any.
val prevPartitionDate = spark.sql(
"select to_date(concat(year_p,'-',month_p,'-',day_p))
from ips.command_room_table
where
to_date(concat(year_p,'-',month_p,'-',day_p)) < to_date(concat($yearAsInt,'-',$monthAsInt,'-',$dayAsInt))
group by year_p, month_p, day_p
order by to_date(concat(year_p,'-',month_p,'-',day_p)) desc limit 1"
).first.getDate(0)
What can I do to resolve this?