title: How to check if value of one column is in the array of another column in Apache Spark?
body: <p>I have a dataframe that looks like this</p>
  <pre><code>+------+--------------------+
  |  col1|                col2|
  +------+--------------------+
  |  red |[red, yellow, pink] |
  | blue |[blue, purple]      |
  |green |[blue, purple]      |
  +------+--------------------+
  </code></pre>
  <p>How could I figure out if the value in col1 is in the value of col2 using scala in Apache Spark?</p>
  <p>I have tried using</p>
  <pre><code>array_contains(col(&quot;col2&quot;), col(&quot;col1&quot;))
  </code></pre>