title: Pyspark: Reference is ambiguous when joining dataframes on same column
body: <p>I am trying to join two dataframes.</p>
  
  <p>I created aliases and referenced them according to this post: <a href="https://stackoverflow.com/questions/33778664/spark-dataframe-distinguish-columns-with-duplicated-name">Spark Dataframe distinguish columns with duplicated name</a></p>
  
  <p>But I am still getting an error about ambiguous columns when it hits the <code>fillna()</code> function, even though I do not reference anything about <code>RetailUnit</code>s.</p>
  
  <pre><code>alloc_ns = allocation_num_spots.alias('alloc_ns')
  avails_ns = avails_num_spots.alias('avails_ns')
  compare_num_avails_inv = avails_ns.join(
      alloc_ns, 
          (F.col('avails_ns.BreakDateTime') == F.col('alloc_ns.AllocationDateTime')) &amp; 
          (F.col('avails_ns.RetailUnit') == F.col('alloc_ns.RetailUnit')), 
          how='left').fillna(
      {'allocs_sum': 0}).withColumn(
      'diff', F.col('avails_sum') - F.col('allocs_sum'))
  </code></pre>
  
  <p>But I keep getting this error:</p>
  
  <pre><code>"Reference 'RetailUnit' is ambiguous, could be: avails_ns.RetailUnit, alloc_ns.RetailUnit.;"
  Traceback (most recent call last):
    File "/usr/lib/spark/python/lib/pyspark.zip/pyspark/sql/dataframe.py", line 1664, in fillna
      return DataFrame(self._jdf.na().fill(value), self.sql_ctx)
    File "/usr/lib/spark/python/lib/py4j-0.10.7-src.zip/py4j/java_gateway.py", line 1257, in __call__
      answer, self.gateway_client, self.target_id, self.name)
    File "/usr/lib/spark/python/lib/pyspark.zip/pyspark/sql/utils.py", line 69, in deco
      raise AnalysisException(s.split(': ', 1)[1], stackTrace)
  pyspark.sql.utils.AnalysisException: "Reference 'RetailUnit' is ambiguous, could be: avails_ns.RetailUnit, alloc_ns.RetailUnit.;"
  </code></pre>
  
  <p>Here is the output of just the join:</p>
  
  <pre><code>+-------------------+----------+----------+-------------------+----------+----------+
  |      BreakDateTime|RetailUnit|avails_sum| AllocationDateTime|RetailUnit|allocs_sum|
  +-------------------+----------+----------+-------------------+----------+----------+
  |2019-05-09 04:15:00|      CFAB|        60|               null|      null|      null|
  |2019-05-09 12:31:00|      CFAB|        60|               null|      null|      null|
  |2019-05-09 03:15:00|      CFAB|        60|               null|      null|      null|
  |2019-05-09 22:45:00|      CFPK|        60|2019-05-09 22:45:00|      CFPK|       120|
  |2019-05-09 00:45:00|      CFPK|       120|2019-05-09 00:45:00|      CFPK|        30|
  |2019-05-09 02:31:00|      CFPK|        60|               null|      null|      null|
  |2019-05-09 13:45:00|      CFPK|        60|2019-05-09 13:45:00|      CFPK|        30|
  |2019-05-09 14:15:00|      CFPK|        60|               null|      null|      null|
  |2019-05-09 23:45:00|      CFPK|        60|2019-05-09 23:45:00|      CFPK|       120|
  +-------------------+----------+----------+-------------------+----------+----------+
  </code></pre>
  
  <p>Could someone explain why this isn't working? I do not want to create separate columns since they should join on the <code>RetailUnit</code>.</p>