title: Reference 'column_name' is ambiguous
body: <p>I am trying the following join query on java spark dataset:</p>
  
  <pre><code>sqlContext.sql("SELECT * from ScheduledTaskTable AS ST1 "
  + "FULL OUTER JOIN (SELECT * from OpenTaskTable WHERE due_date = cast('"+unscheduledDate+"' as timestamp) " 
  + "AND csg_order_id NOT IN(SELECT ST2.csg_order_id from  ScheduledTaskTable AS ST2)) AS UnscheduledTaskTable "
  + "ON ST1.csg_order_id = UnscheduledTaskTable.csg_order_id");
  </code></pre>
  
  <p>The ScheduledTaskTable is derived from OpenTaskTable. I am trying an outer join between ScheduledTaskTable and records from OpenTaskTable which has due_date = 'certain value' and not present in ScheduledTaskTable. 
  But when I am trying to run the above query, spark is giving following error:</p>
  
  <pre><code> Reference 'ST2.csg_order_id' is ambiguous, could be: csg_order_id#1, csg_order_id#71.; line 1 pos 165
  </code></pre>
  
  <p>I searched about the problem, but could not find any strong solution for spark sql. Any help is appreciated.</p>