Select dataframe columns from a sequence of string

Jean-FrancoisRa
New Contributor

Is there a simple way to select columns from a dataframe with a sequence of string?

Something like

val colNames = Seq("c1", "c2")
df.select(colNames)