Hive throws an error when getting a count of distinct rows from a table
<p>I am writing a query to get the count of distinct rows in Hive.</p>

<pre><code>select count(*)
from (select distinct 
        uid, 
        site,
        local_date,
        mktg_chnnl_name,
        mktg_sub_chnnl_name from customer_data)
</code></pre>

<p>But I keep getting this error:</p>

<blockquote>
  <p>ParseException line 3:48 cannot recognize input near 'EOF' 'EOF' 'EOF' in subquery source</p>
</blockquote>

<p>Why is this happening?</p>