title: Spark, DataFrame: Get all distinct strings from many columns
body: <p><strong>Data</strong>: <code>DataFrame</code> that has 15 string columns.</p>
  
  <p><strong>Goal</strong>: To create a list that contains the distinct strings in all the 15 columns.</p>
  
  <p><strong>Example</strong>: if the word "guitar" appears once or more times in the first column, as well as in the forth column, it has to appear once in the final list.</p>
  
  <p><strong>Suggested solution but not ideal</strong>: A UDF is an option to concat all the columns in one new columns, then I can process that column with a <code>CountVectorizer</code> that will extract the vocabulary. But the UDFs are limited as they accept a maximum 10 input parameters (i.e. I can't pass more than 10 columns to a UDF), so this solution has to implement two UDFs, the first to concatenate 10 columns, the second to concatenate the output of the first UDF with the next 5 columns.</p>
  
  <p>I am looking for a more efficient compact solution for this issue, and more generally, a work around solution to the problem of limited number of input parameters for UDFs.</p>