I have following Spark sql and I want to pass variable to it. How to do that? I tried following way.
sqlContext.sql("SELECT count from mytable WHERE id=$id")
Advertisement
Answer
You are almost there just missed s
🙂
sqlContext.sql(s"SELECT count from mytable WHERE id=$id")