title: Left outer Complex Join of Spark DataFrames using Seq("key") syntax
body: <p>I need to convert the below sql join using dataframes . The problem with this is I am getting duplicate "key" columns</p>
  
  <pre><code>val result_sql = sparkSession.sql(" select * from TAB_A a left outer join TAB_B b on a.key = b.key AND a.e_date between b.start_date and b.end_date ")
  
  result_sql.printSchema()
  
  root
  |-- key: string (nullable = true)
  |-- key: string (nullable = true)
  |-- VAL: double (nullable = true)
  </code></pre>
  
  <p>So I have tried this , but landed up with the same duplicate column "key" </p>
  
  <pre><code>val result_df = TAB_A.join(TAB_B,TAB_A.col("key") === TAB_B.col("key")
                               &amp;&amp; TAB_A.col("e_date").between(TAB_B.col("start_date"),TAB_B.col("start_date")),
                          "left_outer")
  
  root
  |-- key: string (nullable = true)
  |-- key: string (nullable = true)
  |-- VAL: double (nullable = true)
  </code></pre>
  
  <p>Then I have tried using Seq , but unable to implement the complex join and facing errors </p>
  
  <pre><code>val result_df = TAB_A.join(TAB_B,Seq("key") &amp;&amp; TAB_A.col("e_date").between(TAB_B.col("start_date"),TAB_B.col("start_date")),
                          "left_outer")
  </code></pre>
  
  <p>Expected Schema :</p>
  
  <pre><code>root
  |-- key: string (nullable = true)
  |-- VAL: double (nullable = true)
  </code></pre>
  
  <p>Any best solution to implement the above logic without duplicate columns.</p>
  
  <p>Note : I am looking for solution using spark dataframes instead of spark_sql query. </p>