title: Create a Column from int[] or List<Integer>
body: <p>I am trying to create a Column (that I will add to a <code>DataSet&lt;Row&gt;</code>) from an <code>int[]</code> or <code>List&lt;Integer&gt;</code> in Java and <a href="https://spark.apache.org/" rel="nofollow noreferrer">Spark</a>.</p>
  
  <p>The values I am using are distinct (because the closest answer I have found is creating a column using the same <code>value funtions.lit(val)</code>).</p>
  
  <pre><code>public Dataset&lt;Row&gt; addColumn(String colName, int value ,int[] values){
          Dataset&lt;Row&gt; ds = data.withColumn(colName, functions.lit(value));
          return ds;
  }
  </code></pre>
  
  <p>this gives a column with the same value.</p>
  
  <p>How create a Column using an <code>int[]</code> or <code>List&lt;Integer&gt;</code>?</p>
  
  <p>Thank you!</p>