Alagappan Maruthappan created HIVE-24784: --------------------------------------------
Summary: Insert into table throws Invalid column reference when select is followed by any other operation Key: HIVE-24784 URL: https://issues.apache.org/jira/browse/HIVE-24784 Project: Hive Issue Type: Bug Components: Hive, HiveServer2 Reporter: Alagappan Maruthappan To Reproduce: {code:java} create table foo (a int, b string); create table bar (a int, b string); explain insert into foo (a, b) select a, b from bar order by b; 21/02/15 23:26:58 ERROR ql.Driver: FAILED: SemanticException [Error 10004]: Line 1:61 Invalid table alias or column reference 'b': (possible column names are: _col0, _col1)21/02/15 23:26:58 ERROR ql.Driver: FAILED: SemanticException [Error 10004]: Line 1:61 Invalid table alias or column reference 'b': (possible column names are: _col0, _col1)org.apache.hadoop.hive.ql.parse.SemanticException: Line 1:61 Invalid table alias or column reference 'b': (possible column names are: _col0, _col1) at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genAllExprNodeDesc(SemanticAnalyzer.java:12962) at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genExprNodeDesc(SemanticAnalyzer.java:12904) at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genExprNodeDesc(SemanticAnalyzer.java:12872) at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genExprNodeDesc(SemanticAnalyzer.java:12866) at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genReduceSinkPlan(SemanticAnalyzer.java:8907) at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genPostGroupByBodyPlan(SemanticAnalyzer.java:11028) at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genBodyPlan(SemanticAnalyzer.java:10930) at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genPlan(SemanticAnalyzer.java:11829) at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genPlan(SemanticAnalyzer.java:11699) at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genOPTree(SemanticAnalyzer.java:12415) at org.apache.hadoop.hive.ql.parse.CalcitePlanner.genOPTree(CalcitePlanner.java:730) at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.analyzeInternal(SemanticAnalyzer.java:12526) at org.apache.hadoop.hive.ql.parse.CalcitePlanner.analyzeInternal(CalcitePlanner.java:455) at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(BaseSemanticAnalyzer.java:301) at org.apache.hadoop.hive.ql.parse.ExplainSemanticAnalyzer.analyzeInternal(ExplainSemanticAnalyzer.java:171) at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(BaseSemanticAnalyzer.java:301) at org.apache.hadoop.hive.ql.Compiler.analyze(Compiler.java:223) at org.apache.hadoop.hive.ql.Compiler.compile(Compiler.java:104) at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:492) {code} Any operation that follows select (order by/cluster by/distribute by) throws this exception. -- This message was sent by Atlassian Jira (v8.3.4#803005)