[jira] [Updated] (HIVE-24186) The aggregate class operation fails when the CBO is false

2020-09-21 Thread GuangMing Lu (Jira)


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

GuangMing Lu updated HIVE-24186:

Affects Version/s: 3.1.2

> The aggregate class operation fails when the CBO is false
> -
>
> Key: HIVE-24186
> URL: https://issues.apache.org/jira/browse/HIVE-24186
> Project: Hive
>  Issue Type: Bug
>  Components: CBO, SQL
>Affects Versions: 3.1.0, 3.1.2
>Reporter: GuangMing Lu
>Priority: Major
>
> {code:java}
> create table table_1
> (
> idx string, 
> namex string
> ) stored as orc;
> create table table_2
> (
> sid string,
> sname string
> )stored as orc;
> set hive.cbo.enable=false;
> explain
> insert into table table_1(idx , namex)
> select t.sid idx, '123' namex 
> from table_2 t
> group by t.sid
> order by 1,2;
> {code}
> Executing the above SQL will report an error, errors as follows:
> {code:java}
> org.apache.hive.service.cli.HiveSQLException: Error while compiling 
> statement: FAILED: SemanticException [Error 10004]: Line 4:7 Invalid table 
> alias or column reference 't': (possible column names are: _col0, _col1)
>     at 
> org.apache.hive.service.cli.operation.Operation.toSQLException(Operation.java:341)
>  ~[hive-service-3.1.0-hw-ei-302001-SNAPSHOT.jar:3.1.0-hw-ei-302001-SNAPSHOT]
>     at 
> org.apache.hive.service.cli.operation.SQLOperation.prepare(SQLOperation.java:215)
>  ~[hive-service-3.1.0-hw-ei-302001-SNAPSHOT.jar:3.1.0-hw-ei-302001-SNAPSHOT]
>     at 
> org.apache.hive.service.cli.operation.SQLOperation.runInternal(SQLOperation.java:316)
>  ~[hive-service-3.1.0-hw-ei-302001-SNAPSHOT.jar:3.1.0-hw-ei-302001-SNAPSHOT]
>     at 
> org.apache.hive.service.cli.operation.Operation.run(Operation.java:253) 
> ~[hive-service-3.1.0-hw-ei-302001-SNAPSHOT.jar:3.1.0-hw-ei-302001-SNAPSHOT]
>     at 
> org.apache.hive.service.cli.session.HiveSessionImpl.executeStatementInternal(HiveSessionImpl.java:684)
>  ~[hive-service-3.1.0-hw-ei-302001-SNAPSHOT.jar:3.1.0-hw-ei-302001-SNAPSHOT]
>     at 
> org.apache.hive.service.cli.session.HiveSessionImpl.executeStatementAsync(HiveSessionImpl.java:670)
>  ~[hive-service-3.1.0-hw-ei-302001-SNAPSHOT.jar:3.1.0-hw-ei-302001-SNAPSHOT]
>     at sun.reflect.GeneratedMethodAccessor151.invoke(Unknown Source) 
> ~[?:?]
>     at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>  ~[?:1.8.0_242]
>     at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_242]
>     at 
> org.apache.hive.service.cli.session.HiveSessionProxy.invoke(HiveSessionProxy.java:78)
>  ~[hive-service-3.1.0-hw-ei-302001-SNAPSHOT.jar:3.1.0-hw-ei-302001-SNAPSHOT]
>     at 
> org.apache.hive.service.cli.session.HiveSessionProxy.access$000(HiveSessionProxy.java:36)
>  ~[hive-service-3.1.0-hw-ei-302001-SNAPSHOT.jar:3.1.0-hw-ei-302001-SNAPSHOT]
>     at 
> org.apache.hive.service.cli.session.HiveSessionProxy$1.run(HiveSessionProxy.java:63)
>  ~[hive-service-3.1.0-hw-ei-302001-SNAPSHOT.jar:3.1.0-hw-ei-302001-SNAPSHOT]
>     at java.security.AccessController.doPrivileged(Native Method) 
> ~[?:1.8.0_242]
>     at javax.security.auth.Subject.doAs(Subject.java:422) ~[?:1.8.0_242]
>     at 
> org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1737)
>  ~[hadoop-common-3.1.1-hw-ei-302001-SNAPSHOT.jar:?]
>     at 
> org.apache.hive.service.cli.session.HiveSessionProxy.invoke(HiveSessionProxy.java:59)
>  ~[hive-service-3.1.0-hw-ei-302001-SNAPSHOT.jar:3.1.0-hw-ei-302001-SNAPSHOT]
>     at com.sun.proxy.$Proxy66.executeStatementAsync(Unknown Source) ~[?:?]
>     at 
> org.apache.hive.service.cli.CLIService.executeStatementAsync(CLIService.java:342)
>  ~[hive-service-3.1.0-hw-ei-302001-SNAPSHOT.jar:3.1.0-hw-ei-302001-SNAPSHOT]
>     at 
> org.apache.hive.service.cli.thrift.ThriftCLIService.executeNewStatement(ThriftCLIService.java:1144)
>  ~[hive-service-3.1.0-hw-ei-302001-SNAPSHOT.jar:3.1.0-hw-ei-302001-SNAPSHOT]
>     at 
> org.apache.hive.service.cli.thrift.ThriftCLIService.ExecuteStatement(ThriftCLIService.java:1280)
>  ~[hive-service-3.1.0-hw-ei-302001-SNAPSHOT.jar:3.1.0-hw-ei-302001-SNAPSHOT]
>     at 
> org.apache.hive.service.rpc.thrift.TCLIService$Processor$ExecuteStatement.getResult(TCLIService.java:1557)
>  
> ~[hive-service-rpc-3.1.0-hw-ei-302001-SNAPSHOT.jar:3.1.0-hw-ei-302001-SNAPSHOT]
>     at 
> org.apache.hive.service.rpc.thrift.TCLIService$Processor$ExecuteStatement.getResult(TCLIService.java:1542)
>  
> ~[hive-service-rpc-3.1.0-hw-ei-302001-SNAPSHOT.jar:3.1.0-hw-ei-302001-SNAPSHOT]
>     at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:39) 
> ~[hive-exec-3.1.0-hw-ei-302001-SNAPSHOT.jar:3.1.0-hw-ei-302001-SNAPSHOT]
>     at 

[jira] [Updated] (HIVE-24186) The aggregate class operation fails when the CBO is false

2020-09-21 Thread GuangMing Lu (Jira)


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

GuangMing Lu updated HIVE-24186:

Fix Version/s: (was: 3.1.2)
   (was: 3.1.0)

> The aggregate class operation fails when the CBO is false
> -
>
> Key: HIVE-24186
> URL: https://issues.apache.org/jira/browse/HIVE-24186
> Project: Hive
>  Issue Type: Bug
>  Components: CBO, SQL
>Affects Versions: 3.1.0
>Reporter: GuangMing Lu
>Priority: Major
>
> {code:java}
> create table table_1
> (
> idx string, 
> namex string
> ) stored as orc;
> create table table_2
> (
> sid string,
> sname string
> )stored as orc;
> set hive.cbo.enable=false;
> explain
> insert into table table_1(idx , namex)
> select t.sid idx, '123' namex 
> from table_2 t
> group by t.sid
> order by 1,2;
> {code}
> Executing the above SQL will report an error, errors as follows:
> {code:java}
> org.apache.hive.service.cli.HiveSQLException: Error while compiling 
> statement: FAILED: SemanticException [Error 10004]: Line 4:7 Invalid table 
> alias or column reference 't': (possible column names are: _col0, _col1)
>     at 
> org.apache.hive.service.cli.operation.Operation.toSQLException(Operation.java:341)
>  ~[hive-service-3.1.0-hw-ei-302001-SNAPSHOT.jar:3.1.0-hw-ei-302001-SNAPSHOT]
>     at 
> org.apache.hive.service.cli.operation.SQLOperation.prepare(SQLOperation.java:215)
>  ~[hive-service-3.1.0-hw-ei-302001-SNAPSHOT.jar:3.1.0-hw-ei-302001-SNAPSHOT]
>     at 
> org.apache.hive.service.cli.operation.SQLOperation.runInternal(SQLOperation.java:316)
>  ~[hive-service-3.1.0-hw-ei-302001-SNAPSHOT.jar:3.1.0-hw-ei-302001-SNAPSHOT]
>     at 
> org.apache.hive.service.cli.operation.Operation.run(Operation.java:253) 
> ~[hive-service-3.1.0-hw-ei-302001-SNAPSHOT.jar:3.1.0-hw-ei-302001-SNAPSHOT]
>     at 
> org.apache.hive.service.cli.session.HiveSessionImpl.executeStatementInternal(HiveSessionImpl.java:684)
>  ~[hive-service-3.1.0-hw-ei-302001-SNAPSHOT.jar:3.1.0-hw-ei-302001-SNAPSHOT]
>     at 
> org.apache.hive.service.cli.session.HiveSessionImpl.executeStatementAsync(HiveSessionImpl.java:670)
>  ~[hive-service-3.1.0-hw-ei-302001-SNAPSHOT.jar:3.1.0-hw-ei-302001-SNAPSHOT]
>     at sun.reflect.GeneratedMethodAccessor151.invoke(Unknown Source) 
> ~[?:?]
>     at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>  ~[?:1.8.0_242]
>     at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_242]
>     at 
> org.apache.hive.service.cli.session.HiveSessionProxy.invoke(HiveSessionProxy.java:78)
>  ~[hive-service-3.1.0-hw-ei-302001-SNAPSHOT.jar:3.1.0-hw-ei-302001-SNAPSHOT]
>     at 
> org.apache.hive.service.cli.session.HiveSessionProxy.access$000(HiveSessionProxy.java:36)
>  ~[hive-service-3.1.0-hw-ei-302001-SNAPSHOT.jar:3.1.0-hw-ei-302001-SNAPSHOT]
>     at 
> org.apache.hive.service.cli.session.HiveSessionProxy$1.run(HiveSessionProxy.java:63)
>  ~[hive-service-3.1.0-hw-ei-302001-SNAPSHOT.jar:3.1.0-hw-ei-302001-SNAPSHOT]
>     at java.security.AccessController.doPrivileged(Native Method) 
> ~[?:1.8.0_242]
>     at javax.security.auth.Subject.doAs(Subject.java:422) ~[?:1.8.0_242]
>     at 
> org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1737)
>  ~[hadoop-common-3.1.1-hw-ei-302001-SNAPSHOT.jar:?]
>     at 
> org.apache.hive.service.cli.session.HiveSessionProxy.invoke(HiveSessionProxy.java:59)
>  ~[hive-service-3.1.0-hw-ei-302001-SNAPSHOT.jar:3.1.0-hw-ei-302001-SNAPSHOT]
>     at com.sun.proxy.$Proxy66.executeStatementAsync(Unknown Source) ~[?:?]
>     at 
> org.apache.hive.service.cli.CLIService.executeStatementAsync(CLIService.java:342)
>  ~[hive-service-3.1.0-hw-ei-302001-SNAPSHOT.jar:3.1.0-hw-ei-302001-SNAPSHOT]
>     at 
> org.apache.hive.service.cli.thrift.ThriftCLIService.executeNewStatement(ThriftCLIService.java:1144)
>  ~[hive-service-3.1.0-hw-ei-302001-SNAPSHOT.jar:3.1.0-hw-ei-302001-SNAPSHOT]
>     at 
> org.apache.hive.service.cli.thrift.ThriftCLIService.ExecuteStatement(ThriftCLIService.java:1280)
>  ~[hive-service-3.1.0-hw-ei-302001-SNAPSHOT.jar:3.1.0-hw-ei-302001-SNAPSHOT]
>     at 
> org.apache.hive.service.rpc.thrift.TCLIService$Processor$ExecuteStatement.getResult(TCLIService.java:1557)
>  
> ~[hive-service-rpc-3.1.0-hw-ei-302001-SNAPSHOT.jar:3.1.0-hw-ei-302001-SNAPSHOT]
>     at 
> org.apache.hive.service.rpc.thrift.TCLIService$Processor$ExecuteStatement.getResult(TCLIService.java:1542)
>  
> ~[hive-service-rpc-3.1.0-hw-ei-302001-SNAPSHOT.jar:3.1.0-hw-ei-302001-SNAPSHOT]
>     at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:39) 
> ~[hive-exec-3.1.0-hw-ei-302001-SNAPSHOT.jar:3.1.0-hw-ei-302001-SNAPSHOT]
>     at