Exam4Training

If you create a database sample_db with the statement CREATE DATABASE sample_db what will be the default location of the database in DBFS?

If you create a database sample_db with the statement CREATE DATABASE sample_db what will be the default location of the database in DBFS?
A . Default location, DBFS:/user/
B . Default location, /user/db/
C . Default Storage account
D . Statement fails “Unable to create database without location”
E . Default Location, dbfs:/user/hive/warehouse

Answer: E

Explanation:

The Answer is dbfs:/user/hive/warehouse this is the default location where spark stores user data-bases, the default can be changed using spark.sql.warehouse.dir a parameter. You can also provide a custom location using the LOCATION keyword. Here is how this works,

Graphical user

interface, text, application, email

Description automatically generated

Default location

FYI, This can be changed used using cluster spark config or session config. Modify spark.sql.warehouse.dir location to change the default location

Graphical user

interface, text, application

Description automatically generated

Exit mobile version