Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-20288

DROP TABLE throws any error/warning while an attempt is made to drop a table which does not exist .

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.2.1, 2.1.1
    • None
    • None
    • None

    Description

      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'

       

       

       

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            vaibhav_hnw vaibhav
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: