title: spark cant join dataframes using left outer join
body: <p>I am trying to join 2 dataframes based on df1.portfolio name to df2.portId
  the resulting dataframe  I do not want the same key repeated.  </p>
  
  <p>here is my code so far </p>
  
  <pre><code>val df = spark.read.json("C:\\json\\portmast") 
  val pgetsec = spark.read.json("C:\\json\\pgetsec")
  
  
  val portfolio_master = df.select("PortfolioCode","Legal Entity Name","Asofdate")
  val pgetsecs= pgetsec.select("TransId", "SecId","portId","GaapCurBkBal","ParBal","SetlDt","SetlPric","OrgBkBal","TradeDt","StatCurBkBal","NaicRtg","SecurityTypeCode","CamraSecType","FundType","CountryIso")
  val pg = portfolio_master.join(pgetsec,Seq("PortfolioCode","portId"),"left_outer")
  </code></pre>
  
  <p>the error I am getting is<br>
   <code>Exception in thread "main" org.apache.spark.sql.AnalysisException: using columns ['PortfolioCode,'portId] can not be resolved given input columns:
  </code>
   Final json should look like this </p>
  
  <pre><code>|-- Portfolio Code: string (nullable = true)
  |-- Legal Entity Name: string (nullable = true)
  |-- Asofdate: string (nullable = true)
  
  ((SI, S&amp;P 500 Index,9/30/2016),[0.0,Equity,Common Stock])
  ((SI, S&amp;P 500 Index,9/30/2016),[0.0,Equity,Common Stock])
  ((SI, S&amp;P 500 Index,9/30/2016),[0.0,Equity,Common Stock])
  [SI1, S&amp;P 500 Index,9/30/2016,CompactBuffer([0.0,Equity,Common     Stock],    [0.0,Equity,Common Stock], [0.0,Equity,Common Stock])]
  root
  |-- Portfolio Code: string (nullable = true)
  |-- Legal Entity Name: string (nullable = true)
  |-- Asofdate: string (nullable = true)
  |-- Security: array (nullable = true)
  |    |-- element: struct (containsNull = true)
  |    |    |-- BondPrice: double (nullable = true)
  |    |    |-- CoreSectorLevel1Code: string (nullable = true)
  |    |    |-- CoreSectorLevel2Code: string (nullable = true)
  
  +--------------+-------------------+---------+--------------------+
  |Portfolio Code|  Legal Entity Name| Asofdate|            Security|
  +--------------+-------------------+---------+--------------------+
  |           SI | S&amp;P 500 Index     |9/30/2016|[[0.0,Equity,Comm...|
  +--------------+-------------------+---------+--------------------+
  </code></pre>
  
  <p>Any help is appreciated.</p>