- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2021 12:07 PM
Hello,
I'm working in Databricks Community Edition. So I will terminate my cluster after my work because anyways it will be terminated after 2 hours. I'm creating a database to store all my transformed data. Will the database be deleted when I terminate the cluster ?
I have tried it and seems like it will delete the database because it doesn't recognize the database name I gave.
Error Message - AnalysisException: Database 'db_name' not found
But I can see my database path in DBFS: dbfs:/user/hive/warehouse/db_name.db.
When I create a new database and try to add data to tables, then there is an error saying that the table already exists and not empty.
Please help me with this problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2021 12:21 PM
Problem is that it is community edition so metastore with databases didn't survive.
please try:
CREATE DATABASE IF NOT EXISTS db_name LOCATION 'dbfs:/user/hive/warehouse/db_name.db'
My blog: https://databrickster.medium.com/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2021 12:37 PM
Thanks for the answer Hubert 😊
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2021 01:15 PM
@Hubert Dudek - Thanks for answering so quickly!!
@Sriram Devineedi - If Hubert's answer solved the issue for you, would you be happy to mark his answer as best? That helps others know where to look.