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

Carl Steinbach commented on HIVE-3609:
--------------------------------------

This makes sense:

{noformat}
hive> SELECT * FROM src LIMIT 1;
OK
key     value
238     val_238
Time taken: 0.061 seconds
hive> SELECT * FROM src a JOIN src b ON (a.key = b.key) LIMIT 1;
OK
key     value   key     value
0       val_0   0       val_0
{noformat}

But this doesn't:

{noformat}
hive> SELECT * FROM (SELECT * FROM src a JOIN src b ON (a.key = b.key) LIMIT 1) 
c;
OK
key     value
0       val_0
{noformat}

Note that the third query produces the following SQL exception when run in 
MySQL:

{noformat}
mysql> SELECT * FROM (SELECT * FROM src a JOIN src b ON (a.key=b.key) LIMIT 1) 
as c;
ERROR 1060 (42S21): Duplicate column name 'key'
{noformat}

I think Hive should throw an exception in this situation too.
                
> Nested sub select queries with duplicate column aliases should throw an error 
> instead of truncating columns
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: HIVE-3609
>                 URL: https://issues.apache.org/jira/browse/HIVE-3609
>             Project: Hive
>          Issue Type: Improvement
>          Components: Query Processor
>            Reporter: Carl Steinbach
>


--
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

Reply via email to