title: Spark apply function to certain columns
body: <p>I have a dataframe with N columns and I have a hashmap where the keys are the columns names and values a tuple (string, boolean). </p>
  
  <p>For each column that is on the hasmap and meets a certain condition -some comparison with the tuple - I have to apply a function to all the elements of that column. </p>
  
  <p>In the end, I have to modify some columns of a dataframe that meet some condition depending on the column name. </p>
  
  <p>What is the best way to do this?</p>