hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "caofangkun (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HIVE-4729) when subquery is a star selection with a group by ,the query will generate Confusing SemanticException
Date Thu, 13 Jun 2013 08:46:21 GMT
caofangkun created HIVE-4729:
--------------------------------

             Summary: when subquery is a star selection  with a group by ,the query will generate
Confusing SemanticException
                 Key: HIVE-4729
                 URL: https://issues.apache.org/jira/browse/HIVE-4729
             Project: Hive
          Issue Type: Bug
          Components: Query Processor
    Affects Versions: 0.8.1, 0.12.0
         Environment: hive-trunk
hadoop-0.20.1
            Reporter: caofangkun
            Assignee: caofangkun
            Priority: Minor


hive (default)> desc src;
OK
key                 	string              	None                
value               	string              	None                
Time taken: 2.887 seconds, Fetched: 2 row(s)
hive (default)> desc src_1;
OK
key                 	string              	None                
value               	string              	None                
Time taken: 0.146 seconds, Fetched: 2 row(s)


SubQuery with 'group by' will generate semantic exception:
explain 
select a.key as a_key, 
        b.key as b_key
 from (select * from src
      group by key, value
      ) a
 left outer join  src_1 b
 on a.key = b.key;
FAILED: Error in semantic analysis: Line 8:6 Invalid column reference 'key'

However the following query will work well :
explain 
select a.key as a_key, 
       b.key as b_key
from (select key,value from src   
      group by key, value
     ) a
left outer join  src_1 b
on a.key = b.key;


In debug mode:
13/06/13 16:09:04 WARN parse.TypeCheckProcFactory: Invalid type entry TOK_TABLE_OR_COL=null
FAILED: SemanticException [Error 10002]: Line 8:5 Invalid column reference 'key'
13/06/13 16:09:04 ERROR ql.Driver: FAILED: SemanticException [Error 10002]: Line 8:5 Invalid
column reference 'key'
org.apache.hadoop.hive.ql.parse.SemanticException: Line 8:5 Invalid column reference 'key'
	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genAllExprNodeDesc(SemanticAnalyzer.java:9002)
	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genExprNodeDesc(SemanticAnalyzer.java:8950)
	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genExprNodeDesc(SemanticAnalyzer.java:8921)
	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genJoinReduceSinkChild(SemanticAnalyzer.java:5982)
	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genJoinOperator(SemanticAnalyzer.java:6079)
	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genJoinPlan(SemanticAnalyzer.java:6240)
	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genPlan(SemanticAnalyzer.java:8057)
	at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.analyzeInternal(SemanticAnalyzer.java:8720)
	at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(BaseSemanticAnalyzer.java:277)
	at org.apache.hadoop.hive.ql.parse.ExplainSemanticAnalyzer.analyzeInternal(ExplainSemanticAnalyzer.java:50)
	at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(BaseSemanticAnalyzer.java:277)
	at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:433)
	at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:337)
	at org.apache.hadoop.hive.ql.Driver.run(Driver.java:902)
	at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:259)
	at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:216)
	at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:413)
	at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:348)
	at org.apache.hadoop.hive.cli.CliDriver.processReader(CliDriver.java:446)
	at org.apache.hadoop.hive.cli.CliDriver.processFile(CliDriver.java:456)
	at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:122)
	at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:413)
	at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:782)
	at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:675)
	at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:614)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.hadoop.util.RunJar.main(RunJar.java:156)

13/06/13 16:09:04 INFO ql.Driver: </PERFLOG method=compile start=1371110941624 end=1371110944658
duration=3034>

 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message