title: Why can't hive recognize alias named in select part?
body: <p>Here's the scenario: When I invoke hql as follows, it tells me that it cannot find alias for u1.</p>
  
  <pre><code>hive&gt; select user as u1, url as u2 from rank_test where u1 != "";
  FAILED: SemanticException [Error 10004]: Line 1:50 Invalid table alias or column reference 'u1': (possible column names are: user, url)
  </code></pre>
  
  <p>This problem is the same as when I try to use <code>count(*) as cnt</code>. Could anyone give me some hint on how to use alias in where clause? Thanks a lot!</p>
  
  <pre><code>hive&gt; select user, count(*) as cnt from rank_test where cnt &gt;= 2 group by user;
  FAILED: ParseException line 1:58 missing EOF at 'where' near 'user'
  </code></pre>