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

Ferdinand Xu commented on HIVE-11241:
-------------------------------------

[~xuefuz], I take a closer look at the code. Yes, you are right. There is some 
ambiguity in the grammar. One way to solve it is to give a warning info to the 
user when they are trying to create a table with the same name as the database 
and keeping the same usage of present describe statement. Another way is to 
disable the usage of "describe tblName.colName" and use the grammar like 
"describe tblName [colName]" instead like mysql. 
https://dev.mysql.com/doc/refman/5.0/en/explain.html
Any thoughts?

> Database prefix does not work properly if table has same name
> -------------------------------------------------------------
>
>                 Key: HIVE-11241
>                 URL: https://issues.apache.org/jira/browse/HIVE-11241
>             Project: Hive
>          Issue Type: Bug
>          Components: Database/Schema
>            Reporter: Johndee Burks
>            Assignee: Ferdinand Xu
>         Attachments: HIVE-11241.patch
>
>
> If you do the following it will fail: 
> {code}
> 0: jdbc:hive2://cdh54-1.test.com:10000/defaul> create database test4; 
> No rows affected (0.881 seconds) 
> 0: jdbc:hive2://cdh54-1.test.com:10000/defaul> use test4; 
> No rows affected (0.1 seconds) 
> 0: jdbc:hive2://cdh54-1.test.com:10000/defaul> create table test4 (c1 
> char(200)); 
> No rows affected (0.306 seconds) 
> 0: jdbc:hive2://cdh54-1.test.com:10000/defaul> desc test4.test4; 
> Error: Error while processing statement: FAILED: Execution Error, return code 
> 1 from org.apache.hadoop.hive.ql.exec.DDLTask. cannot find field test4 from 
> [0:c1] (state=08S01,code=1)
> {code}



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

Reply via email to