You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by John Pullokkaran <jp...@hortonworks.com> on 2015/11/11 02:52:42 UTC
Re: Review Request 39425: Invalid column ref error in order by when
using column alias in select clause and using having
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/39425/#review106005
-----------------------------------------------------------
Ship it!
Ship It!
- John Pullokkaran
On Oct. 18, 2015, 9:47 p.m., pengcheng xiong wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/39425/
> -----------------------------------------------------------
>
> (Updated Oct. 18, 2015, 9:47 p.m.)
>
>
> Review request for hive, Ashutosh Chauhan and John Pullokkaran.
>
>
> Repository: hive-git
>
>
> Description
> -------
>
> Hive CLI session:
> {noformat}
> hive> create table abc(foo int, bar string);
> OK
> Time taken: 0.633 seconds
> hive> select foo as c0, count(*) as c1 from abc group by foo, bar having bar like '%abc%' order by foo;
> FAILED: SemanticException [Error 10004]: Line 1:93 Invalid table alias or column reference 'foo': (possible column names are: c0, c1)
> {noformat}
> Without having clause, the query runs fine, example:
> {code}
> select foo as c0, count(*) as c1 from abc group by foo, bar order by foo;
> {code}
>
>
> Diffs
> -----
>
> ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java e13356c
> ql/src/java/org/apache/hadoop/hive/ql/parse/QBParseInfo.java 14a7e9c
> ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java 3262887
> ql/src/test/queries/clientnegative/alias_groupby_orderby.q PRE-CREATION
> ql/src/test/queries/clientpositive/lineage3.q 70d4e57
> ql/src/test/results/clientnegative/alias_groupby_orderby.q.out PRE-CREATION
> ql/src/test/results/clientpositive/lineage3.q.out ad965c8
>
> Diff: https://reviews.apache.org/r/39425/diff/
>
>
> Testing
> -------
>
>
> Thanks,
>
> pengcheng xiong
>
>