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

Dropping hive database/table which was created explicitly in default database location, deletes all databases data from default database location

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Patch Available
    • Minor
    • Resolution: Unresolved
    • 1.2.1
    • None
    • Hive
    • None

    Description

      When database/table is created explicitly pointing to the default location, dropping the database/table deletes all the data associated with the all databases/tables.

      Steps to replicate:
      in below e.g. dropping table test_db2 also deletes data of test_db1 where as metastore still contains test_db1

      hive> create database test_db1;
      OK
      Time taken: 4.858 seconds

      hive> describe database test_db1;
      OK
      test_db1 hdfs://sandbox.hortonworks.com:8020/apps/hive/warehouse/test_db1.db root USER
      Time taken: 0.599 seconds, Fetched: 1 row(s)

      hive> create database test_db2 location '/apps/hive/warehouse' ;
      OK
      Time taken: 1.457 seconds

      hive> describe database test_db2;
      OK
      test_db2 hdfs://sandbox.hortonworks.com:8020/apps/hive/warehouse root USER
      Time taken: 0.582 seconds, Fetched: 1 row(s)

      hive> drop database test_db2;
      OK
      Time taken: 1.317 seconds

      hive> dfs -ls /apps/hive/warehouse;
      ls: `/apps/hive/warehouse': No such file or directory
      Command failed with exit code = 1
      Query returned non-zero code: 1, cause: null

      hive> describe database test_db1;
      OK
      test_db1 hdfs://sandbox.hortonworks.com:8020/apps/hive/warehouse/test_db1.db root USER
      Time taken: 0.629 seconds, Fetched: 1 row(s)

      Attachments

        1. HIVE-16950.1.patch
          1 kB
          Oleksiy Sayankin
        2. HIVE-16950.10.patch
          9 kB
          Oleksiy Sayankin
        3. HIVE-16950.2.patch
          3 kB
          Oleksiy Sayankin
        4. HIVE-16950.3.patch
          10 kB
          Oleksiy Sayankin
        5. HIVE-16950.4.patch
          12 kB
          Oleksiy Sayankin
        6. HIVE-16950.5.patch
          4 kB
          Oleksiy Sayankin
        7. HIVE-16950.6.patch
          9 kB
          Oleksiy Sayankin
        8. HIVE-16950.7.patch
          9 kB
          Oleksiy Sayankin
        9. HIVE-16950.8.patch
          9 kB
          Oleksiy Sayankin
        10. HIVE-16950.9.patch
          9 kB
          Oleksiy Sayankin

        Issue Links

          Activity

            People

              osayankin Oleksiy Sayankin
              krahul Rahul Kalgunde
              Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated: