Hello there,

I am trying to  pass parameters in spark.sql query in Java code, the same
as in this link
https://forums.databricks.com/questions/115/how-do-i-pass-parameters-to-my-sql-statements.html

The link suggested to use 's' before 'select' as -
val param = 100
 spark.sql(s""" select * from table where parameter = $param """)

it works for scala and python, but it doesn't work for Java. I also tried
.format() but failed as well.

Does anyone know how to dynamically pass parameters in sql using Java?
Greatly appreciate your help.

Best,

Mann

Reply via email to