hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yogesh dhari <>
Subject RE: ERROR: Hive subquery showing
Date Thu, 27 Sep 2012 20:01:50 GMT

Hi Bejoy,

I tried this one also but here it throws horrible error:


hive: select name from ABD where grp=MAX(grp);

FAILED: Hive Internal Error: java.lang.NullPointerException(null)
    at org.apache.hadoop.hive.ql.plan.ExprNodeGenericFuncDesc.newInstance(
    at org.apache.hadoop.hive.ql.parse.TypeCheckProcFactory$DefaultExprProcessor.getXpathOrFuncExprNodeDesc(
    at org.apache.hadoop.hive.ql.parse.TypeCheckProcFactory$DefaultExprProcessor.process(
    at org.apache.hadoop.hive.ql.lib.DefaultRuleDispatcher.dispatch(
    at org.apache.hadoop.hive.ql.lib.DefaultGraphWalker.dispatch(
    at org.apache.hadoop.hive.ql.lib.DefaultGraphWalker.walk(
    at org.apache.hadoop.hive.ql.lib.DefaultGraphWalker.startWalking(
    at org.apache.hadoop.hive.ql.parse.TypeCheckProcFactory.genExprNode(
    at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genExprNodeDesc(
    at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genExprNodeDesc(
    at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genFilterPlan(
    at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genFilterPlan(
    at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genBodyPlan(
    at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genPlan(
    at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.analyzeInternal(
    at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(
    at org.apache.hadoop.hive.ql.Driver.compile(
    at org.apache.hadoop.hive.ql.Driver.compile(
    at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(
    at org.apache.hadoop.hive.cli.CliDriver.processCmd(
    at org.apache.hadoop.hive.cli.CliDriver.processLine(
    at org.apache.hadoop.hive.cli.CliDriver.main(
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(
    at java.lang.reflect.Method.invoke(
    at org.apache.hadoop.util.RunJar.main(

Yogesh Kumar

Subject: Re: ERROR: Hive subquery showing
Date: Thu, 27 Sep 2012 19:48:25 +0000

Hi yogesh

What about a query like this
select name from ABC WHERE grp=MAX(grp); 

Bejoy KS

Sent from handheld, please excuse typos.From:  Chen Song <>
Date: Thu, 27 Sep 2012 15:33:11 -0400To: <>ReplyTo:
Subject: Re: ERROR: Hive subquery showing
Can you try this?
select name from ( select MAX(grp) as name from ABC ) gy ;

On Thu, Sep 27, 2012 at 3:29 PM, yogesh dhari <> wrote:

Hi all,

I have a table called ABC, like

name    grp
A             1
B             2
C             4
D             8

I want the output like the name having greatest grp i.e D;

I wrote a query:

select name from ( select MAX(grp) from ABC ) gy ;

but it gives error

FAILED: Error in semantic analysis: Line 1:7 Invalid table alias or column reference 'name':
(possible column names are: _col0)

Please help and suggest why it is so, and what would be the query;

Thanks & regards
Yogesh Kumar


Chen Song

View raw message