I can\'t figure it out, but guess it\'s simple. I have a spark dataframe df. This df has columns \"A\",\"B\" and \"C\". Now let\'s say I have an Array containing the name of
You were almost there: just map the filtered array to col and unpack the list using : _*:
col
: _*
df.select(column_names.filter(_!="B").map(col): _*)