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

Alexander Pivovarov updated HIVE-9528:
--------------------------------------
    Description: 
When running the following query:
{code}
SELECT if( COUNT(*) = 0, 'true', 'false' ) as RESULT FROM ( select  *  from sim 
a join sim2 b on a.simstr=b.simstr) app

Error: Error while compiling statement: FAILED: SemanticException [Error 
10007]: Ambiguous column reference simstr in app (state=42000,code=10007)
{code}
This query works fine in hive 0.10

In the apache trunk, following workaround will work:
{code}
SELECT if(COUNT(*) = 0, 'true', 'false') as RESULT FROM (select a.* from sim a 
join sim2 b on a.simstr=b.simstr) app;
{code}

  was:
When running the following query:

SELECT if( COUNT( * ) == 0, 'true', 'false' ) as RESULT FROM ( select  *  from 
sim a join sim2 b on a.simstr=b.simstr) app

Error: Error while compiling statement: FAILED: SemanticException [Error 
10007]: Ambiguous column reference simstr in app (state=42000,code=10007)

This query works fine in hive 0.10

In the apache trunk, following workaround will work:
SELECT if(COUNT( * ) == 0, 'true', 'false') as RESULT FROM (select a.* from sim 
a join sim2 b on a.simstr=b.simstr) app;


> SemanticException: Ambiguous column reference
> ---------------------------------------------
>
>                 Key: HIVE-9528
>                 URL: https://issues.apache.org/jira/browse/HIVE-9528
>             Project: Hive
>          Issue Type: Bug
>    Affects Versions: 0.14.0
>            Reporter: Yongzhi Chen
>
> When running the following query:
> {code}
> SELECT if( COUNT(*) = 0, 'true', 'false' ) as RESULT FROM ( select  *  from 
> sim a join sim2 b on a.simstr=b.simstr) app
> Error: Error while compiling statement: FAILED: SemanticException [Error 
> 10007]: Ambiguous column reference simstr in app (state=42000,code=10007)
> {code}
> This query works fine in hive 0.10
> In the apache trunk, following workaround will work:
> {code}
> SELECT if(COUNT(*) = 0, 'true', 'false') as RESULT FROM (select a.* from sim 
> a join sim2 b on a.simstr=b.simstr) app;
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to