[ 
https://issues.apache.org/jira/browse/HIVE-2348?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13125036#comment-13125036
 ] 

Chinna Rao Lalam commented on HIVE-2348:
----------------------------------------

Hi,

The same query is not working in oracle and it is throwing below message

 Error: ORA-00904: "SUMCL_FLOOR": invalid identifier

But same query is working fine in MySql

This type of queries should support in HIVE?
because in oracle it is not working and mysql it is working (Need some 
suggestions)

Here problem may be the column alias. This query is not throwing any exception..

select offer, level_id, sum_cl_score FROM xxx GROUP BY offer, level_id, 
sum_cl_score ORDER BY offer, level_id, sum_cl_score limit 1000000;

Column Alias with group by is failing :

select offer, level_id, sum_cl_score as sumcl_floor FROM xxx GROUP BY offer, 
level_id, sumcl_floor limit 1000000;

FAILED: Error in semantic analysis: Line 1:89 Invalid table alias or column 
reference 'sumcl_floor': (possible column names are: offer, level_id, 
sum_cl_score)

Column Alias with order by is passing :

select offer, level_id, sum_cl_score as sumcl_floor FROM xxx ORDER BY offer, 
level_id, sumcl_floor limit 1000000;
                
> Group by and order by of the same columns fails semantic analysis
> -----------------------------------------------------------------
>
>                 Key: HIVE-2348
>                 URL: https://issues.apache.org/jira/browse/HIVE-2348
>             Project: Hive
>          Issue Type: Bug
>    Affects Versions: 0.7.1
>            Reporter: Edward Capriolo
>
> select offer, level_id, sum_cl_score as sumcl_floor
> FROM xxx
> GROUP BY offer, level_id, sumcl_floor 
> ORDER BY offer, level_id, sumcl_floor limit 1000000;
> FAILED: Error in semantic analysis: Invalid Table Alias or Column Reference 
> sumcl_floor

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to