i am trying to convert below in spark
val forX=spark.sql(""" select * from abc where tv='Dish' and to_date(acd)>='2022-10-11 where indicator ='X' """)
val forY=spark.sql(""" select * from abc where tv='Dish' and to_date(acd)>='2022-10-11 where indicator ='Y' """)
val forZ=spark.sql(""" select * from abc where tv='Dish' and to_date(acd)>='2022-10-11 where indicator ='Z' """)
the above dataframe gives out as
val Mylist:List[String]=List("X","Y","S","I")
for (i <- Mylist)
val eindicator =spark.sql(""" select * from abc where tv="Dish" and to_date(acd)>='2022-10-11'
and indicator=${i} """)
println("#############",eindicator)
its giving as cannot resolve 'X' from input column
Any suggestions how to pass that $i value ?