Shankar Shankar - 1 year ago 60
Scala Question

How does $ symbol working when selecting columns from DataFrame?

when we try to select Columns from DataFrame, one can use

or just

My question is how
$ symbol
[which returns ColumnName] is working, i can understand i need to
import sqlContext.implicits._
to use $ symbol on

I dont see
$ method
class as well. I can see one method with the name
symbolToColumn(scala.Symbol s)

Can someone explain more on this?

Answer Source

It comes from StringToColumn implicit inner class in SQLImplicits (which is implemented by the implicits object).

StringContext is the way that f / s and other string interpolators are written in Scala.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download