title: Avoiding column duplicate column names when joining two data frames in PySpark
body: <p>I have the following code:</p>
  
  <pre><code>from pyspark.sql import SQLContext
  ctx = SQLContext(sc)
  a = ctx.createDataFrame([("1","a",1),("2","a",1),("3","a",0),("4","a",0),("5","b",1),("6","b",0),("7","b",1)],["id","group","value1"])
  b = ctx.createDataFrame([("1","a",8),("2","a",1),("3","a",1),("4","a",2),("5","b",1),("6","b",3),("7","b",4)],["id","group","value2"])
  c = a.join(b,"id")
  c.select("group")
  </code></pre>
  
  <p>It returns an error:</p>
  
  <pre><code>pyspark.sql.utils.AnalysisException: Reference 'group' is ambiguous, could be: group#1406, group#1409.;
  </code></pre>
  
  <p>The problem is that <code>c</code> has twice the same column <code>"group"</code>:</p>
  
  <pre><code>&gt;&gt;&gt; c.columns
  ['id', 'group', 'value1', 'group', 'value2']
  </code></pre>
  
  <p>I would like to be able to do <code>c.select("a.group")</code> for example but I don't know how to have the column names automatically adjusted when doing the join.</p>