easimadi
New Contributor II

@chandras​ 

The sting Interpolation for scala is below.

You can use it to build your query.

Similar exists for python.

1. Your parameters

val p1 = "('0001','0002','0003')"
val p2 = "chandras"

2. Build the query

val query  = s"select * from df where id in $p1 and name = $p2"

3. Then you can query it.

val df1 = sqlContext.sql(query)