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.
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'
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'
12-20-2021 12:37 PM
Thanks for the answer Hubert 😊
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.
Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections.
Click here to register and join today!
Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.