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

Naveen Gangam commented on HIVE-12184:
--------------------------------------

[~ashutoshc] [~xuefuz] Thanks for pointing to these jiras. Sounds like we want 
to simplify the syntax and not make any assumptions. 
Something like 
DESCRIBE [DBNAME.]TABLENAME [COLNAME]
would be the cleanest. 
dbname(optional) and tablename are DOT-separated while table and (optional) 
column are SPACE-separated.

Currently, the implementation already supports the above syntax. But it also 
supports additional forms where table and column can also be DOT-separated that 
will need to be dropped going forward.

However, I have a couple of concerns with changing the grammar.
1) The semantics of this grammar conflicts with the semantics of SELECT queries 
where (optional) table and column are DOT-separated.
2) Such change would not be backward compatible and any attempts to maintain 
backward compatibility will make matter worse. IMHO, even if we do this in a 
major release, it will still break user scripts when they upgrade.

Given that we already have support for all forms (pending this bug), should we 
just update Hive-->help and the documentation to provide guidance on 
recommended syntax? 

Thank you

> DESCRIBE of fully qualified table fails when db and table name match and 
> non-default database is in use
> -------------------------------------------------------------------------------------------------------
>
>                 Key: HIVE-12184
>                 URL: https://issues.apache.org/jira/browse/HIVE-12184
>             Project: Hive
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 1.2.1
>            Reporter: Lenni Kuff
>            Assignee: Naveen Gangam
>         Attachments: HIVE-12184.2.patch, HIVE-12184.patch
>
>
> DESCRIBE of fully qualified table fails when db and table name match and 
> non-default database is in use.
> Repro:
> {code}
> : jdbc:hive2://localhost:10000/default> create database foo;
> No rows affected (0.116 seconds)
> 0: jdbc:hive2://localhost:10000/default> create table foo.foo(i int);
> 0: jdbc:hive2://localhost:10000/default> describe foo.foo;
> +-----------+------------+----------+--+
> | col_name  | data_type  | comment  |
> +-----------+------------+----------+--+
> | i         | int        |          |
> +-----------+------------+----------+--+
> 1 row selected (0.049 seconds)
> 0: jdbc:hive2://localhost:10000/default> use foo;
> 0: jdbc:hive2://localhost:10000/default> describe foo.foo;
> Error: Error while processing statement: FAILED: Execution Error, return code 
> 1 from org.apache.hadoop.hive.ql.exec.DDLTask. Error in getting fields from 
> serde.Invalid Field foo (state=08S01,code=1)
> {code}



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

Reply via email to