Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-25464

Dropping database can remove the hive warehouse directory contents

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 2.3.1
    • None
    • SQL
    • None

    Description

      Create Database.

      CREATE (DATABASE|SCHEMA) [IF NOT EXISTS] db_name [COMMENT comment_text] [*LOCATION*path] [WITH DBPROPERTIES (key1=val1, key2=val2, ...)]           {{LOCATION }}If the specified path does not already exist in the underlying file system, this command tries to create a directory with the path. *When the database is dropped later, this directory is not deleted, but currently it is deleting the directory as well.

      please refer the below link

      [databricks documentation|
      https://docs.databricks.com/spark/latest/spark-sql/language-manual/create-database.html
      ]

      if i create the database as below

      create database db1 location '/user/hive/warehouse'; //this is hive warehouse directory   

      on dropping this db it will also delete the warehouse directory which contains the other db information.

      Attachments

        Activity

          People

            Unassigned Unassigned
            koolsen@gmail.com Sushanta Sen
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: