You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Walter Wu (JIRA)" <ji...@apache.org> on 2017/02/10 07:38:42 UTC

[jira] [Updated] (HIVE-15874) Invalid position alias in Group By when CBO failed

     [ https://issues.apache.org/jira/browse/HIVE-15874?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Walter Wu updated HIVE-15874:
-----------------------------
    Description: 
for example:
SELECT
*
FROM 
(
SELECT * FROM 
table_a
WHERE hp_statdate = '2017-02-09'
) a
LEFT OUTER JOIN 
(
SELECT column_1,2017 AS column_2
FROM table_b
WHERE hp_statdate = '2017-02-09' 
GROUP BY 1,2
) b
ON a.column_1 = b.column_1
LEFT OUTER JOIN 
table_c  c
ON b.column_1 = c.column_1;

error info:
FAILED: SemanticException [Error 10220]: Invalid position alias in Group By
Position alias: 2017 does not exist
The Select List is indexed from 1 to 2

the first process Position Alias result:
SELECT column_1,2017 AS column_2
FROM table_b
WHERE hp_statdate = '2017-02-09' 
GROUP BY column_1,2017
when CBO is enabled and CBO optimize failed, Position Alias will be processed one more time , this lead to '2017' out of the column range

  was:
for example:
SELECT 2017 as column_1,cloumn_2 from table GROUP BY 1,2 ;

error info:
FAILED: SemanticException [Error 10220]: Invalid position alias in Group By
Position alias: 2017 does not exist
The Select List is indexed from 1 to 2

the first process Position Alias result:
SELECT 2017 as column_1,cloumn_2 from table GROUP BY 2017,cloumn_2 ;
when CBO is enabled and CBO optimize failed, Position Alias will be processed one more time , this lead to '2017' out of the column range


> Invalid position alias in Group By when CBO failed 
> ---------------------------------------------------
>
>                 Key: HIVE-15874
>                 URL: https://issues.apache.org/jira/browse/HIVE-15874
>             Project: Hive
>          Issue Type: Bug
>          Components: CBO
>    Affects Versions: 1.2.1
>            Reporter: Walter Wu
>
> for example:
> SELECT
> *
> FROM 
> (
> SELECT * FROM 
> table_a
> WHERE hp_statdate = '2017-02-09'
> ) a
> LEFT OUTER JOIN 
> (
> SELECT column_1,2017 AS column_2
> FROM table_b
> WHERE hp_statdate = '2017-02-09' 
> GROUP BY 1,2
> ) b
> ON a.column_1 = b.column_1
> LEFT OUTER JOIN 
> table_c  c
> ON b.column_1 = c.column_1;
> error info:
> FAILED: SemanticException [Error 10220]: Invalid position alias in Group By
> Position alias: 2017 does not exist
> The Select List is indexed from 1 to 2
> the first process Position Alias result:
> SELECT column_1,2017 AS column_2
> FROM table_b
> WHERE hp_statdate = '2017-02-09' 
> GROUP BY column_1,2017
> when CBO is enabled and CBO optimize failed, Position Alias will be processed one more time , this lead to '2017' out of the column range



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)