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

2017-02-20 Thread Walter Wu (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-15874?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15875249#comment-15875249
 ] 

Walter Wu edited comment on HIVE-15874 at 2/21/17 2:33 AM:
---

Thanks [~pxiong] for review. 


was (Author: walter wu):
Thanks Pengcheng Xiong for review.

> 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, 2.1.1
>Reporter: Walter Wu
>Assignee: Pengcheng Xiong
> Fix For: 2.2.0
>
> Attachments: HIVE-15874.patch
>
>
> for example:
> create table alias_test_01(a INT, b STRING) ;
> create table alias_test_02(a INT, b STRING) ;
> create table alias_test_03(a INT, b STRING) ;
> set hive.groupby.position.alias = true;
> set hive.cbo.enable=true;
> explain 
> select * from 
> alias_test_01 alias01 
> left join 
> (
> select 2017 as a, b from alias_test_02 group by 1, 2
> ) alias02 
> on alias01.a = alias02.a 
> left join 
> alias_test_03 alias03
> on alias01.a = alias03.a;
> 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:
> when CBO optimize failed and reAnalyzeAST is true, position alias will be 
> processed twice.
> 1.   'group by 1, 2' convert to 'group by 2017, b'
> 2.   'group by 2017, b'  2017 column does not exist



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


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

2017-02-20 Thread Walter Wu (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-15874?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15875249#comment-15875249
 ] 

Walter Wu edited comment on HIVE-15874 at 2/21/17 2:27 AM:
---

Thanks Pengcheng Xiong for review.


was (Author: walter wu):
Thanks Pengcheng Xiong for review 

> 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, 2.1.1
>Reporter: Walter Wu
>Assignee: Pengcheng Xiong
> Fix For: 2.2.0
>
> Attachments: HIVE-15874.patch
>
>
> for example:
> create table alias_test_01(a INT, b STRING) ;
> create table alias_test_02(a INT, b STRING) ;
> create table alias_test_03(a INT, b STRING) ;
> set hive.groupby.position.alias = true;
> set hive.cbo.enable=true;
> explain 
> select * from 
> alias_test_01 alias01 
> left join 
> (
> select 2017 as a, b from alias_test_02 group by 1, 2
> ) alias02 
> on alias01.a = alias02.a 
> left join 
> alias_test_03 alias03
> on alias01.a = alias03.a;
> 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:
> when CBO optimize failed and reAnalyzeAST is true, position alias will be 
> processed twice.
> 1.   'group by 1, 2' convert to 'group by 2017, b'
> 2.   'group by 2017, b'  2017 column does not exist



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


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

2017-02-20 Thread Walter Wu (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-15874?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15875249#comment-15875249
 ] 

Walter Wu edited comment on HIVE-15874 at 2/21/17 2:26 AM:
---

Thanks Pengcheng Xiong for review 


was (Author: walter wu):
Thanks Pengcheng Xiong for review 

> 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, 2.1.1
>Reporter: Walter Wu
>Assignee: Pengcheng Xiong
> Fix For: 2.2.0
>
> Attachments: HIVE-15874.patch
>
>
> for example:
> create table alias_test_01(a INT, b STRING) ;
> create table alias_test_02(a INT, b STRING) ;
> create table alias_test_03(a INT, b STRING) ;
> set hive.groupby.position.alias = true;
> set hive.cbo.enable=true;
> explain 
> select * from 
> alias_test_01 alias01 
> left join 
> (
> select 2017 as a, b from alias_test_02 group by 1, 2
> ) alias02 
> on alias01.a = alias02.a 
> left join 
> alias_test_03 alias03
> on alias01.a = alias03.a;
> 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:
> when CBO optimize failed and reAnalyzeAST is true, position alias will be 
> processed twice.
> 1.   'group by 1, 2' convert to 'group by 2017, b'
> 2.   'group by 2017, b'  2017 column does not exist



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


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

2017-02-20 Thread Walter Wu (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-15874?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15875249#comment-15875249
 ] 

Walter Wu edited comment on HIVE-15874 at 2/21/17 2:23 AM:
---

Thanks Pengcheng Xiong for review 


was (Author: walter wu):
Thanks pxiong Pengcheng Xiong for review 

> 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, 2.1.1
>Reporter: Walter Wu
>Assignee: Pengcheng Xiong
> Fix For: 2.2.0
>
> Attachments: HIVE-15874.patch
>
>
> for example:
> create table alias_test_01(a INT, b STRING) ;
> create table alias_test_02(a INT, b STRING) ;
> create table alias_test_03(a INT, b STRING) ;
> set hive.groupby.position.alias = true;
> set hive.cbo.enable=true;
> explain 
> select * from 
> alias_test_01 alias01 
> left join 
> (
> select 2017 as a, b from alias_test_02 group by 1, 2
> ) alias02 
> on alias01.a = alias02.a 
> left join 
> alias_test_03 alias03
> on alias01.a = alias03.a;
> 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:
> when CBO optimize failed and reAnalyzeAST is true, position alias will be 
> processed twice.
> 1.   'group by 1, 2' convert to 'group by 2017, b'
> 2.   'group by 2017, b'  2017 column does not exist



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


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

2017-02-20 Thread Walter Wu (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-15874?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15875249#comment-15875249
 ] 

Walter Wu edited comment on HIVE-15874 at 2/21/17 2:22 AM:
---

Thanks pxiong Pengcheng Xiong for review 


was (Author: walter wu):
Thanks Pengcheng Xiong for review 

> 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, 2.1.1
>Reporter: Walter Wu
>Assignee: Pengcheng Xiong
> Fix For: 2.2.0
>
> Attachments: HIVE-15874.patch
>
>
> for example:
> create table alias_test_01(a INT, b STRING) ;
> create table alias_test_02(a INT, b STRING) ;
> create table alias_test_03(a INT, b STRING) ;
> set hive.groupby.position.alias = true;
> set hive.cbo.enable=true;
> explain 
> select * from 
> alias_test_01 alias01 
> left join 
> (
> select 2017 as a, b from alias_test_02 group by 1, 2
> ) alias02 
> on alias01.a = alias02.a 
> left join 
> alias_test_03 alias03
> on alias01.a = alias03.a;
> 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:
> when CBO optimize failed and reAnalyzeAST is true, position alias will be 
> processed twice.
> 1.   'group by 1, 2' convert to 'group by 2017, b'
> 2.   'group by 2017, b'  2017 column does not exist



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


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

2017-02-20 Thread Walter Wu (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-15874?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15875249#comment-15875249
 ] 

Walter Wu commented on HIVE-15874:
--

Thanks Pengcheng Xiong for review 

> 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, 2.1.1
>Reporter: Walter Wu
>Assignee: Pengcheng Xiong
> Fix For: 2.2.0
>
> Attachments: HIVE-15874.patch
>
>
> for example:
> create table alias_test_01(a INT, b STRING) ;
> create table alias_test_02(a INT, b STRING) ;
> create table alias_test_03(a INT, b STRING) ;
> set hive.groupby.position.alias = true;
> set hive.cbo.enable=true;
> explain 
> select * from 
> alias_test_01 alias01 
> left join 
> (
> select 2017 as a, b from alias_test_02 group by 1, 2
> ) alias02 
> on alias01.a = alias02.a 
> left join 
> alias_test_03 alias03
> on alias01.a = alias03.a;
> 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:
> when CBO optimize failed and reAnalyzeAST is true, position alias will be 
> processed twice.
> 1.   'group by 1, 2' convert to 'group by 2017, b'
> 2.   'group by 2017, b'  2017 column does not exist



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


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

2017-02-20 Thread Walter Wu (JIRA)

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

Walter Wu updated HIVE-15874:
-
Status: Patch Available  (was: Open)

> 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: 2.1.1, 1.2.1
>Reporter: Walter Wu
>Assignee: Pengcheng Xiong
> Attachments: HIVE-15874.patch
>
>
> for example:
> create table alias_test_01(a INT, b STRING) ;
> create table alias_test_02(a INT, b STRING) ;
> create table alias_test_03(a INT, b STRING) ;
> set hive.groupby.position.alias = true;
> set hive.cbo.enable=true;
> explain 
> select * from 
> alias_test_01 alias01 
> left join 
> (
> select 2017 as a, b from alias_test_02 group by 1, 2
> ) alias02 
> on alias01.a = alias02.a 
> left join 
> alias_test_03 alias03
> on alias01.a = alias03.a;
> 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:
> when CBO optimize failed and reAnalyzeAST is true, position alias will be 
> processed twice.
> 1.   'group by 1, 2' convert to 'group by 2017, b'
> 2.   'group by 2017, b'  2017 column does not exist



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


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

2017-02-20 Thread Walter Wu (JIRA)

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

Walter Wu updated HIVE-15874:
-
Attachment: HIVE-15874.patch

> 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, 2.1.1
>Reporter: Walter Wu
>Assignee: Pengcheng Xiong
> Attachments: HIVE-15874.patch
>
>
> for example:
> create table alias_test_01(a INT, b STRING) ;
> create table alias_test_02(a INT, b STRING) ;
> create table alias_test_03(a INT, b STRING) ;
> set hive.groupby.position.alias = true;
> set hive.cbo.enable=true;
> explain 
> select * from 
> alias_test_01 alias01 
> left join 
> (
> select 2017 as a, b from alias_test_02 group by 1, 2
> ) alias02 
> on alias01.a = alias02.a 
> left join 
> alias_test_03 alias03
> on alias01.a = alias03.a;
> 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:
> when CBO optimize failed and reAnalyzeAST is true, position alias will be 
> processed twice.
> 1.   'group by 1, 2' convert to 'group by 2017, b'
> 2.   'group by 2017, b'  2017 column does not exist



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


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

2017-02-20 Thread Walter Wu (JIRA)

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

Walter Wu updated HIVE-15874:
-
Attachment: (was: HIVE-15874.1.patch)

> 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, 2.1.1
>Reporter: Walter Wu
>Assignee: Pengcheng Xiong
>
> for example:
> create table alias_test_01(a INT, b STRING) ;
> create table alias_test_02(a INT, b STRING) ;
> create table alias_test_03(a INT, b STRING) ;
> set hive.groupby.position.alias = true;
> set hive.cbo.enable=true;
> explain 
> select * from 
> alias_test_01 alias01 
> left join 
> (
> select 2017 as a, b from alias_test_02 group by 1, 2
> ) alias02 
> on alias01.a = alias02.a 
> left join 
> alias_test_03 alias03
> on alias01.a = alias03.a;
> 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:
> when CBO optimize failed and reAnalyzeAST is true, position alias will be 
> processed twice.
> 1.   'group by 1, 2' convert to 'group by 2017, b'
> 2.   'group by 2017, b'  2017 column does not exist



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


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

2017-02-19 Thread Walter Wu (JIRA)

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

Walter Wu reassigned HIVE-15874:


Assignee: Pengcheng Xiong

> 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, 2.1.1
>Reporter: Walter Wu
>Assignee: Pengcheng Xiong
> Attachments: HIVE-15874.1.patch
>
>
> for example:
> create table alias_test_01(a INT, b STRING) ;
> create table alias_test_02(a INT, b STRING) ;
> create table alias_test_03(a INT, b STRING) ;
> set hive.groupby.position.alias = true;
> set hive.cbo.enable=true;
> explain 
> select * from 
> alias_test_01 alias01 
> left join 
> (
> select 2017 as a, b from alias_test_02 group by 1, 2
> ) alias02 
> on alias01.a = alias02.a 
> left join 
> alias_test_03 alias03
> on alias01.a = alias03.a;
> 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:
> when CBO optimize failed and reAnalyzeAST is true, position alias will be 
> processed twice.
> 1.   'group by 1, 2' convert to 'group by 2017, b'
> 2.   'group by 2017, b'  2017 column does not exist



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


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

2017-02-19 Thread Walter Wu (JIRA)

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

Walter Wu updated HIVE-15874:
-
Attachment: HIVE-15874.1.patch

> 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, 2.1.1
>Reporter: Walter Wu
> Attachments: HIVE-15874.1.patch
>
>
> for example:
> create table alias_test_01(a INT, b STRING) ;
> create table alias_test_02(a INT, b STRING) ;
> create table alias_test_03(a INT, b STRING) ;
> set hive.groupby.position.alias = true;
> set hive.cbo.enable=true;
> explain 
> select * from 
> alias_test_01 alias01 
> left join 
> (
> select 2017 as a, b from alias_test_02 group by 1, 2
> ) alias02 
> on alias01.a = alias02.a 
> left join 
> alias_test_03 alias03
> on alias01.a = alias03.a;
> 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:
> when CBO optimize failed and reAnalyzeAST is true, position alias will be 
> processed twice.
> 1.   'group by 1, 2' convert to 'group by 2017, b'
> 2.   'group by 2017, b'  2017 column does not exist



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


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

2017-02-19 Thread Walter Wu (JIRA)

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

Walter Wu updated HIVE-15874:
-
Comment: was deleted

(was: HIVE-15874.1.patch)

> 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, 2.1.1
>Reporter: Walter Wu
>
> for example:
> create table alias_test_01(a INT, b STRING) ;
> create table alias_test_02(a INT, b STRING) ;
> create table alias_test_03(a INT, b STRING) ;
> set hive.groupby.position.alias = true;
> set hive.cbo.enable=true;
> explain 
> select * from 
> alias_test_01 alias01 
> left join 
> (
> select 2017 as a, b from alias_test_02 group by 1, 2
> ) alias02 
> on alias01.a = alias02.a 
> left join 
> alias_test_03 alias03
> on alias01.a = alias03.a;
> 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:
> when CBO optimize failed and reAnalyzeAST is true, position alias will be 
> processed twice.
> 1.   'group by 1, 2' convert to 'group by 2017, b'
> 2.   'group by 2017, b'  2017 column does not exist



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


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

2017-02-19 Thread Walter Wu (JIRA)

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

Walter Wu updated HIVE-15874:
-
Status: Patch Available  (was: Open)

HIVE-15874.1.patch

> 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: 2.1.1, 1.2.1
>Reporter: Walter Wu
>
> for example:
> create table alias_test_01(a INT, b STRING) ;
> create table alias_test_02(a INT, b STRING) ;
> create table alias_test_03(a INT, b STRING) ;
> set hive.groupby.position.alias = true;
> set hive.cbo.enable=true;
> explain 
> select * from 
> alias_test_01 alias01 
> left join 
> (
> select 2017 as a, b from alias_test_02 group by 1, 2
> ) alias02 
> on alias01.a = alias02.a 
> left join 
> alias_test_03 alias03
> on alias01.a = alias03.a;
> 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:
> when CBO optimize failed and reAnalyzeAST is true, position alias will be 
> processed twice.
> 1.   'group by 1, 2' convert to 'group by 2017, b'
> 2.   'group by 2017, b'  2017 column does not exist



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


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

2017-02-19 Thread Walter Wu (JIRA)

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

Walter Wu updated HIVE-15874:
-
Status: Open  (was: Patch Available)

> 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: 2.1.1, 1.2.1
>Reporter: Walter Wu
>
> for example:
> create table alias_test_01(a INT, b STRING) ;
> create table alias_test_02(a INT, b STRING) ;
> create table alias_test_03(a INT, b STRING) ;
> set hive.groupby.position.alias = true;
> set hive.cbo.enable=true;
> explain 
> select * from 
> alias_test_01 alias01 
> left join 
> (
> select 2017 as a, b from alias_test_02 group by 1, 2
> ) alias02 
> on alias01.a = alias02.a 
> left join 
> alias_test_03 alias03
> on alias01.a = alias03.a;
> 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:
> when CBO optimize failed and reAnalyzeAST is true, position alias will be 
> processed twice.
> 1.   'group by 1, 2' convert to 'group by 2017, b'
> 2.   'group by 2017, b'  2017 column does not exist



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


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

2017-02-19 Thread Walter Wu (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-15874?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15874116#comment-15874116
 ] 

Walter Wu commented on HIVE-15874:
--

Use MR engine. 
Before CBO optimize, processPositionAlias will be called once. 'select 2017 as 
a, b from alias_test_02 group by 1, 2' will be transformed into  'select 2017 
as a, b from alias_test_02 group by 2017, b'.
When CBO optimize failed and reAnalyzeAST is set to true, processPositionAlias 
will be called twice. '2017' will be considered to column alias. Error : 
'Invalid position alias in Group By' will occur.
Obviously, we just need process position alias one time. So the most intuitive 
and effective way is stepping processPositionAlias out of genResolvedParseTree.

> 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, 2.1.1
>Reporter: Walter Wu
>
> for example:
> create table alias_test_01(a INT, b STRING) ;
> create table alias_test_02(a INT, b STRING) ;
> create table alias_test_03(a INT, b STRING) ;
> set hive.groupby.position.alias = true;
> set hive.cbo.enable=true;
> explain 
> select * from 
> alias_test_01 alias01 
> left join 
> (
> select 2017 as a, b from alias_test_02 group by 1, 2
> ) alias02 
> on alias01.a = alias02.a 
> left join 
> alias_test_03 alias03
> on alias01.a = alias03.a;
> 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:
> when CBO optimize failed and reAnalyzeAST is true, position alias will be 
> processed twice.
> 1.   'group by 1, 2' convert to 'group by 2017, b'
> 2.   'group by 2017, b'  2017 column does not exist



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


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

2017-02-17 Thread Walter Wu (JIRA)

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

Walter Wu updated HIVE-15874:
-
Affects Version/s: (was: storage-2.2.0)
   2.1.1

> 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, 2.1.1
>Reporter: Walter Wu
>
> for example:
> create table alias_test_01(a INT, b STRING) ;
> create table alias_test_02(a INT, b STRING) ;
> create table alias_test_03(a INT, b STRING) ;
> set hive.groupby.position.alias = true;
> set hive.cbo.enable=true;
> explain 
> select * from 
> alias_test_01 alias01 
> left join 
> (
> select 2017 as a, b from alias_test_02 group by 1, 2
> ) alias02 
> on alias01.a = alias02.a 
> left join 
> alias_test_03 alias03
> on alias01.a = alias03.a;
> 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:
> when CBO optimize failed and reAnalyzeAST is true, position alias will be 
> processed twice.
> 1.   'group by 1, 2' convert to 'group by 2017, b'
> 2.   'group by 2017, b'  2017 column does not exist



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


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

2017-02-17 Thread Walter Wu (JIRA)

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

Walter Wu updated HIVE-15874:
-
Affects Version/s: 1.2.1

> 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, 2.1.1
>Reporter: Walter Wu
>
> for example:
> create table alias_test_01(a INT, b STRING) ;
> create table alias_test_02(a INT, b STRING) ;
> create table alias_test_03(a INT, b STRING) ;
> set hive.groupby.position.alias = true;
> set hive.cbo.enable=true;
> explain 
> select * from 
> alias_test_01 alias01 
> left join 
> (
> select 2017 as a, b from alias_test_02 group by 1, 2
> ) alias02 
> on alias01.a = alias02.a 
> left join 
> alias_test_03 alias03
> on alias01.a = alias03.a;
> 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:
> when CBO optimize failed and reAnalyzeAST is true, position alias will be 
> processed twice.
> 1.   'group by 1, 2' convert to 'group by 2017, b'
> 2.   'group by 2017, b'  2017 column does not exist



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


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

2017-02-17 Thread Walter Wu (JIRA)

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

Walter Wu updated HIVE-15874:
-
Affects Version/s: (was: 1.2.1)
   storage-2.2.0

> 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: storage-2.2.0
>Reporter: Walter Wu
>
> for example:
> create table alias_test_01(a INT, b STRING) ;
> create table alias_test_02(a INT, b STRING) ;
> create table alias_test_03(a INT, b STRING) ;
> set hive.groupby.position.alias = true;
> set hive.cbo.enable=true;
> explain 
> select * from 
> alias_test_01 alias01 
> left join 
> (
> select 2017 as a, b from alias_test_02 group by 1, 2
> ) alias02 
> on alias01.a = alias02.a 
> left join 
> alias_test_03 alias03
> on alias01.a = alias03.a;
> 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:
> when CBO optimize failed and reAnalyzeAST is true, position alias will be 
> processed twice.
> 1.   'group by 1, 2' convert to 'group by 2017, b'
> 2.   'group by 2017, b'  2017 column does not exist



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


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

2017-02-17 Thread Walter Wu (JIRA)

 [ 
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:
create table alias_test_01(a INT, b STRING) ;
create table alias_test_02(a INT, b STRING) ;
create table alias_test_03(a INT, b STRING) ;

set hive.groupby.position.alias = true;
set hive.cbo.enable=true;

explain 
select * from 
alias_test_01 alias01 
left join 
(
select 2017 as a, b from alias_test_02 group by 1, 2
) alias02 
on alias01.a = alias02.a 
left join 
alias_test_03 alias03
on alias01.a = alias03.a;

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:
when CBO optimize failed and reAnalyzeAST is true, position alias will be 
processed twice.
1.   'group by 1, 2' convert to 'group by 2017, b'
2.   'group by 2017, b'  2017 column does not exist


  was:
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


> 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: storage-2.2.0
>Reporter: Walter Wu
>
> for example:
> create table alias_test_01(a INT, b STRING) ;
> create table alias_test_02(a INT, b STRING) ;
> create table alias_test_03(a INT, b STRING) ;
> set hive.groupby.position.alias = true;
> set hive.cbo.enable=true;
> explain 
> select * from 
> alias_test_01 alias01 
> left join 
> (
> select 2017 as a, b from alias_test_02 group by 1, 2
> ) alias02 
> on alias01.a = alias02.a 
> left join 
> alias_test_03 alias03
> on alias01.a = alias03.a;
> 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:
> when CBO optimize failed and reAnalyzeAST is true, position alias will be 
> processed twice.
> 1.   'group by 1, 2' convert to 'group by 2017, b'
> 2.   'group by 2017, b'  2017 column does not exist



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


[jira] [Resolved] (HIVE-15888) constant propagation optimizer failed when query has the same alias with subquery

2017-02-13 Thread Walter Wu (JIRA)

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

Walter Wu resolved HIVE-15888.
--
Resolution: Duplicate

> constant propagation optimizer failed when query has the same alias with 
> subquery
> -
>
> Key: HIVE-15888
> URL: https://issues.apache.org/jira/browse/HIVE-15888
> Project: Hive
>  Issue Type: Bug
>  Components: Logical Optimizer
>Affects Versions: 1.2.1
>Reporter: Walter Wu
>
> Example  :
> select * 
> from dpdim_employee_org_d c 
> join 
> (
> select a.* from dpmid_md_organization a
> left outer join dpmid_md_organization b 
> on a.organizationid = b.superiororganizationid and b.hisdate = '2016-10-05'
> where a.hisdate = '2016-09-05'
> and b.organizationid is null 
> ) b 
> on c.org_id = b.organizationid 
> and c.hp_cal_dt = '2016-09-05' limit 10;
> Description:
> when ppd optimize is enabled this query has empty result . If we unenabled 
> constant propagation optimize or we replace the subquery alias 'b' with 'b1' 
> , this query will work correctly.
> I explain this query and find that after ppd optimize Filter Operator 
> predicate conf changed from 'predicate: superiororganizationid is not null 
> (type: boolean)' to 'predicate: false (type: boolean)'.
> The subquery has a filter predicate conf 'b.organizationid is 
> null','b.organizationid' should equal to 'b:b.organizationid' . The outer 
> query has a filter predicate conf 'b.organizationid is not null', 
> 'b.organizationid' should equal to 'b:a.organizationid'. While rowSchema get 
> Column Info on tabAlias:'b' and alias:'organizationid'. constant propagation 
> optimize combine 'b.organizationid is not null' and  'b.organizationid is 
> null' to 'constant false' . 



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


[jira] [Commented] (HIVE-15888) constant propagation optimizer failed when query has the same alias with subquery

2017-02-13 Thread Walter Wu (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-15888?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15864935#comment-15864935
 ] 

Walter Wu commented on HIVE-15888:
--

I find it has been fixed in https://issues.apache.org/jira/browse/HIVE-13602

> constant propagation optimizer failed when query has the same alias with 
> subquery
> -
>
> Key: HIVE-15888
> URL: https://issues.apache.org/jira/browse/HIVE-15888
> Project: Hive
>  Issue Type: Bug
>  Components: Logical Optimizer
>Affects Versions: 1.2.1
>Reporter: Walter Wu
>
> Example  :
> select * 
> from dpdim_employee_org_d c 
> join 
> (
> select a.* from dpmid_md_organization a
> left outer join dpmid_md_organization b 
> on a.organizationid = b.superiororganizationid and b.hisdate = '2016-10-05'
> where a.hisdate = '2016-09-05'
> and b.organizationid is null 
> ) b 
> on c.org_id = b.organizationid 
> and c.hp_cal_dt = '2016-09-05' limit 10;
> Description:
> when ppd optimize is enabled this query has empty result . If we unenabled 
> constant propagation optimize or we replace the subquery alias 'b' with 'b1' 
> , this query will work correctly.
> I explain this query and find that after ppd optimize Filter Operator 
> predicate conf changed from 'predicate: superiororganizationid is not null 
> (type: boolean)' to 'predicate: false (type: boolean)'.
> The subquery has a filter predicate conf 'b.organizationid is 
> null','b.organizationid' should equal to 'b:b.organizationid' . The outer 
> query has a filter predicate conf 'b.organizationid is not null', 
> 'b.organizationid' should equal to 'b:a.organizationid'. While rowSchema get 
> Column Info on tabAlias:'b' and alias:'organizationid'. constant propagation 
> optimize combine 'b.organizationid is not null' and  'b.organizationid is 
> null' to 'constant false' . 



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


[jira] [Assigned] (HIVE-15888) constant propagation optimizer failed when query has the same alias with subquery

2017-02-13 Thread Walter Wu (JIRA)

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

Walter Wu reassigned HIVE-15888:


Assignee: (was: Walter Wu)

> constant propagation optimizer failed when query has the same alias with 
> subquery
> -
>
> Key: HIVE-15888
> URL: https://issues.apache.org/jira/browse/HIVE-15888
> Project: Hive
>  Issue Type: Bug
>  Components: Logical Optimizer
>Affects Versions: 1.2.1
>Reporter: Walter Wu
>
> Example  :
> select * 
> from dpdim_employee_org_d c 
> join 
> (
> select a.* from dpmid_md_organization a
> left outer join dpmid_md_organization b 
> on a.organizationid = b.superiororganizationid and b.hisdate = '2016-10-05'
> where a.hisdate = '2016-09-05'
> and b.organizationid is null 
> ) b 
> on c.org_id = b.organizationid 
> and c.hp_cal_dt = '2016-09-05' limit 10;
> Description:
> when ppd optimize is enabled this query has empty result . If we unenabled 
> constant propagation optimize or we replace the subquery alias 'b' with 'b1' 
> , this query will work correctly.
> I explain this query and find that after ppd optimize Filter Operator 
> predicate conf changed from 'predicate: superiororganizationid is not null 
> (type: boolean)' to 'predicate: false (type: boolean)'.
> The subquery has a filter predicate conf 'b.organizationid is 
> null','b.organizationid' should equal to 'b:b.organizationid' . The outer 
> query has a filter predicate conf 'b.organizationid is not null', 
> 'b.organizationid' should equal to 'b:a.organizationid'. While rowSchema get 
> Column Info on tabAlias:'b' and alias:'organizationid'. constant propagation 
> optimize combine 'b.organizationid is not null' and  'b.organizationid is 
> null' to 'constant false' . 



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


[jira] [Assigned] (HIVE-15888) constant propagation optimizer failed when query has the same alias with subquery

2017-02-13 Thread Walter Wu (JIRA)

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

Walter Wu reassigned HIVE-15888:


Assignee: Walter Wu

> constant propagation optimizer failed when query has the same alias with 
> subquery
> -
>
> Key: HIVE-15888
> URL: https://issues.apache.org/jira/browse/HIVE-15888
> Project: Hive
>  Issue Type: Bug
>  Components: Logical Optimizer
>Affects Versions: 1.2.1
>Reporter: Walter Wu
>Assignee: Walter Wu
>
> Example  :
> select * 
> from dpdim_employee_org_d c 
> join 
> (
> select a.* from dpmid_md_organization a
> left outer join dpmid_md_organization b 
> on a.organizationid = b.superiororganizationid and b.hisdate = '2016-10-05'
> where a.hisdate = '2016-09-05'
> and b.organizationid is null 
> ) b 
> on c.org_id = b.organizationid 
> and c.hp_cal_dt = '2016-09-05' limit 10;
> Description:
> when ppd optimize is enabled this query has empty result . If we unenabled 
> constant propagation optimize or we replace the subquery alias 'b' with 'b1' 
> , this query will work correctly.
> I explain this query and find that after ppd optimize Filter Operator 
> predicate conf changed from 'predicate: superiororganizationid is not null 
> (type: boolean)' to 'predicate: false (type: boolean)'.
> The subquery has a filter predicate conf 'b.organizationid is 
> null','b.organizationid' should equal to 'b:b.organizationid' . The outer 
> query has a filter predicate conf 'b.organizationid is not null', 
> 'b.organizationid' should equal to 'b:a.organizationid'. While rowSchema get 
> Column Info on tabAlias:'b' and alias:'organizationid'. constant propagation 
> optimize combine 'b.organizationid is not null' and  'b.organizationid is 
> null' to 'constant false' . 



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


[jira] [Updated] (HIVE-15888) constant propagation optimizer failed when query has the same alias with subquery

2017-02-13 Thread Walter Wu (JIRA)

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

Walter Wu updated HIVE-15888:
-
Summary: constant propagation optimizer failed when query has the same 
alias with subquery  (was: PPD optimizer failed when query has the same alias 
with subquery)

> constant propagation optimizer failed when query has the same alias with 
> subquery
> -
>
> Key: HIVE-15888
> URL: https://issues.apache.org/jira/browse/HIVE-15888
> Project: Hive
>  Issue Type: Bug
>  Components: Logical Optimizer
>Affects Versions: 1.2.1
>Reporter: Walter Wu
>
> Example  :
> select * 
> from dpdim_employee_org_d c 
> join 
> (
> select a.* from dpmid_md_organization a
> left outer join dpmid_md_organization b 
> on a.organizationid = b.superiororganizationid and b.hisdate = '2016-10-05'
> where a.hisdate = '2016-09-05'
> and b.organizationid is null 
> ) b 
> on c.org_id = b.organizationid 
> and c.hp_cal_dt = '2016-09-05' limit 10;
> Description:
> when ppd optimize is enabled this query has empty result . If we unenabled 
> ppd optimize or we replace the subquery alias 'b' with 'b1' , this query will 
> work correctly.
> I explain this query and find that after ppd optimize Filter Operator 
> predicate conf changed from 'predicate: superiororganizationid is not null 
> (type: boolean)' to 'predicate: false (type: boolean)'.
> The subquery has a filter predicate conf 'b.organizationid is 
> null','b.organizationid' should equal to 'b:b.organizationid' . The outer 
> query has a filter predicate conf 'b.organizationid is not null', 
> 'b.organizationid' should equal to 'b:a.organizationid'. While rowSchema get 
> Column Info on tabAlias:'b' and alias:'organizationid'. ppd optimize combine 
> 'b.organizationid is not null' and  'b.organizationid is null' to 'constant 
> false' . 



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


[jira] [Updated] (HIVE-15888) constant propagation optimizer failed when query has the same alias with subquery

2017-02-13 Thread Walter Wu (JIRA)

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

Walter Wu updated HIVE-15888:
-
Description: 
Example  :
select * 
from dpdim_employee_org_d c 
join 
(
select a.* from dpmid_md_organization a
left outer join dpmid_md_organization b 
on a.organizationid = b.superiororganizationid and b.hisdate = '2016-10-05'
where a.hisdate = '2016-09-05'
and b.organizationid is null 
) b 
on c.org_id = b.organizationid 
and c.hp_cal_dt = '2016-09-05' limit 10;

Description:
when ppd optimize is enabled this query has empty result . If we unenabled 
constant propagation optimize or we replace the subquery alias 'b' with 'b1' , 
this query will work correctly.
I explain this query and find that after ppd optimize Filter Operator predicate 
conf changed from 'predicate: superiororganizationid is not null (type: 
boolean)' to 'predicate: false (type: boolean)'.
The subquery has a filter predicate conf 'b.organizationid is 
null','b.organizationid' should equal to 'b:b.organizationid' . The outer query 
has a filter predicate conf 'b.organizationid is not null', 'b.organizationid' 
should equal to 'b:a.organizationid'. While rowSchema get Column Info on 
tabAlias:'b' and alias:'organizationid'. constant propagation optimize combine 
'b.organizationid is not null' and  'b.organizationid is null' to 'constant 
false' . 

  was:
Example  :
select * 
from dpdim_employee_org_d c 
join 
(
select a.* from dpmid_md_organization a
left outer join dpmid_md_organization b 
on a.organizationid = b.superiororganizationid and b.hisdate = '2016-10-05'
where a.hisdate = '2016-09-05'
and b.organizationid is null 
) b 
on c.org_id = b.organizationid 
and c.hp_cal_dt = '2016-09-05' limit 10;

Description:
when ppd optimize is enabled this query has empty result . If we unenabled ppd 
optimize or we replace the subquery alias 'b' with 'b1' , this query will work 
correctly.
I explain this query and find that after ppd optimize Filter Operator predicate 
conf changed from 'predicate: superiororganizationid is not null (type: 
boolean)' to 'predicate: false (type: boolean)'.
The subquery has a filter predicate conf 'b.organizationid is 
null','b.organizationid' should equal to 'b:b.organizationid' . The outer query 
has a filter predicate conf 'b.organizationid is not null', 'b.organizationid' 
should equal to 'b:a.organizationid'. While rowSchema get Column Info on 
tabAlias:'b' and alias:'organizationid'. ppd optimize combine 'b.organizationid 
is not null' and  'b.organizationid is null' to 'constant false' . 


> constant propagation optimizer failed when query has the same alias with 
> subquery
> -
>
> Key: HIVE-15888
> URL: https://issues.apache.org/jira/browse/HIVE-15888
> Project: Hive
>  Issue Type: Bug
>  Components: Logical Optimizer
>Affects Versions: 1.2.1
>Reporter: Walter Wu
>
> Example  :
> select * 
> from dpdim_employee_org_d c 
> join 
> (
> select a.* from dpmid_md_organization a
> left outer join dpmid_md_organization b 
> on a.organizationid = b.superiororganizationid and b.hisdate = '2016-10-05'
> where a.hisdate = '2016-09-05'
> and b.organizationid is null 
> ) b 
> on c.org_id = b.organizationid 
> and c.hp_cal_dt = '2016-09-05' limit 10;
> Description:
> when ppd optimize is enabled this query has empty result . If we unenabled 
> constant propagation optimize or we replace the subquery alias 'b' with 'b1' 
> , this query will work correctly.
> I explain this query and find that after ppd optimize Filter Operator 
> predicate conf changed from 'predicate: superiororganizationid is not null 
> (type: boolean)' to 'predicate: false (type: boolean)'.
> The subquery has a filter predicate conf 'b.organizationid is 
> null','b.organizationid' should equal to 'b:b.organizationid' . The outer 
> query has a filter predicate conf 'b.organizationid is not null', 
> 'b.organizationid' should equal to 'b:a.organizationid'. While rowSchema get 
> Column Info on tabAlias:'b' and alias:'organizationid'. constant propagation 
> optimize combine 'b.organizationid is not null' and  'b.organizationid is 
> null' to 'constant false' . 



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


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

2017-02-09 Thread Walter Wu (JIRA)

 [ 
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)