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

vaibhav commented on HIVE-20288:
--------------------------------

By default hive.exec.drop.ignorenonexistent is set to "TRUE" 

-- Setting the same to FALSE gives the expected result on console .

hive> set hive.exec.drop.ignorenonexistent;
hive.exec.drop.ignorenonexistent=true
hive> set hive.exec.drop.ignorenonexistent=false;
hive> drop table xyz;
FAILED: SemanticException [Error 10001]: Table not found xyz

> DROP TABLE throws any error/warning while an attempt is made to drop a table 
> which does not exist .
> ---------------------------------------------------------------------------------------------------
>
>                 Key: HIVE-20288
>                 URL: https://issues.apache.org/jira/browse/HIVE-20288
>             Project: Hive
>          Issue Type: Bug
>    Affects Versions: 1.2.1, 2.1.1
>            Reporter: vaibhav
>            Priority: Major
>
> When I do DROP TABLE ( for a table which really does not exist in the 
> database) in hive .It really don't throw any warning/error and just show OK 
> (the same message as the table is present and was dropped ).
> =========
> hive> show tables;
> OK
> Time taken: 0.921 seconds
> hive>
> > drop table tabledoesnotexist;
> OK
> Time taken: 0.355 seconds
>  
>  
> Hive.log :
> 2018-08-01 09:36:07,575 ERROR [main]: metadata.Hive 
> (Hive.java:getTable(1215)) - Table tabledoesnotexist not found: 
> temp.tabledoesnotexist table not found
> ========
> hive> show tables;
> OK
> Time taken: 2.096 seconds
> hive> drop table if exists tabledoesnotexist;
> OK
> Time taken: 0.145 seconds
> ========
> hive> create table test(id int);
> OK
> Time taken: 1.258 seconds
> hive> drop table test;
> OK
> Time taken: 0.561 seconds
>  
>  
> In general, the database should return an Error if the table is not present.
> Eg : MySQL:
> mysql> drop table test;
>  [Code: 1051, SQL State: 42S02]  Unknown table 'test'
>  
>  
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to