'Spark Scala - how to use $"col" and S string interpolation together?
I want to achieve this, with a $ instead of col()
val x = "id"
df.select(col(s"$x"))
This gives me an error
df.select($s"$x")
But this works -- How is it working without the s prefix? And is this the correct way?
df.select($"$x")
Thanks.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
