title: AnalysisException: Reference 'count' is ambiguous
body: <h2>Given:</h2>
  
  <p><strong>Dataset:</strong></p>
  
  <pre><code>+--------------------+
  |               count|
  +--------------------+
  |                 1.0|
  |                 2.0|
  |                 3.0|
  +--------------------+
  </code></pre>
  
  <p><strong>Code:</strong></p>
  
  <pre><code>String field = "count";    
  
  Dataset&lt;Row&gt; histogram = dataset
      .groupBy(field)
      .count()
      .persist(StrorageLevel.MEMORY_ONLY_SER());
  
  Column cnt = histogram.col("count"); // trying to get .count() result
  </code></pre>
  
  <p><strong>Histogram schema:</strong></p>
  
  <pre><code>root
   |-- count: double (nullable = true) // input field `count`
   |-- count: long (nullable = false)  // .count() result
  </code></pre>
  
  <p><strong>Exception:</strong></p>
  
  <pre><code>org.apache.spark.sql.AnalysisException: Reference 'count' is ambiguous, could be: count#101, count#108L.;
  </code></pre>
  
  <h2>Question:</h2>
  
  <p>While I understand, why this happens, I don't have any ideas about how to solve this problem. Dataset is created from a table in the database and may contain any number of columns with any names, including <code>count</code>, <code>avg</code> and other "reserved" words.</p>
  
  <p>Any help appretiated.</p>