title: Multiply PySpark array column by a scalar
body: <p>I am trying to multiply an array typed column by a scalar. This scalar is also a value from the same PySpark dataframe.</p>
  <p>For example, I have this dataframe:</p>
  <pre><code>df = sc.parallelize([([1, 2],3)]).toDF([&quot;l&quot;,&quot;factor&quot;])
  +------+------+
  |     l|factor|
  +------+------+
  |[1, 2]|     3|
  +------+------+
  </code></pre>
  <p>What I want to achieve is this:</p>
  <pre><code>+------+------+
  |     l|factor|
  +------+------+
  |[3, 6]|     3|
  +------+------+
  </code></pre>
  <p>This is what I have tried:</p>
  <pre><code>df.withColumn(&quot;l&quot;, lit(&quot;factor&quot;) * df.l)
  </code></pre>
  <p>It returns a type mismatch error.
  How can I multiply an array typed column by a number?</p>