title: Spark: Joining with array
body: <p>I need to join a dataframe with a string column to one with array of string so that if one of the values in the array is matched, the rows will join.</p>
  
  <p>I tried this but I guess it's not support. 
  Any other way to do this?</p>
  
  <pre><code>import org.apache.spark.SparkConf
  import org.apache.spark.sql.SparkSession
  
  val sparkConf = new SparkConf().setMaster("local[*]").setAppName("test")
  val spark = SparkSession.builder().config(sparkConf).getOrCreate()
  
  import spark.implicits._
  
  val left = spark.sparkContext.parallelize(Seq(1, 2, 3)).toDF("col1")
  val right = spark.sparkContext.parallelize(Seq((Array(1, 2), "Yes"),(Array(3),"No"))).toDF("col1", "col2")
  
  left.join(right,"col1")
  </code></pre>
  
  <p>Throws:</p>
  
  <blockquote>
    <p>org.apache.spark.sql.AnalysisException:  cannot resolve '(<code>col1</code>
    =<code>col1</code>)' due to data 
    type mismatch: differing types in '(<code>col1</code> =</p>
    
    <p><code>col1</code>)' (int and array).;;</p>
  </blockquote>