[ 
https://issues.apache.org/jira/browse/HIVE-7300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14225285#comment-14225285
 ] 

Sergio Peña commented on HIVE-7300:
-----------------------------------

Hi [~sourabhpotnis],

The LOCATION keyword specifies to Hive where the database you're creating will 
reside. In the example you wrote, you are specifying the location as 
/addh0010/hive/addh0011/warehouse, so all tables will be stored in that 
location.

If you want to create a different location for the database, then you will need 
to run this:
# hdfs dfs -mkdir /addh0010/hive/addh0011/warehouse/test_loc.db

On Hive:
# CREATE DATABASE test_loc LOCATION 
'/addh0010/hive/addh0011/warehouse/test_loc.db';

> When creating database by specifying location, .db is not created
> -----------------------------------------------------------------
>
>                 Key: HIVE-7300
>                 URL: https://issues.apache.org/jira/browse/HIVE-7300
>             Project: Hive
>          Issue Type: Bug
>            Reporter: sourabh potnis
>              Labels: .db, database, location
>
> When I create a database without specifying location:
> e.g. create database test;
> it will get created in /apps/hive/warehouse/ as /apps/hive/warehouse/test.db
> But when I create database by specifying location:
> e.g. create database test_loc location '/addh0010/hive/addh0011/warehouse';
> Database will be created but /addh0010/hive/addh0011/warehouse/test_loc.db 
> does not get created.
> So if user tries to create 2 tables with same name in two different databases 
> at same location. We are not sure if table is created.
> So when database is created with location, .db directory should be created 
> with that database name at that location.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to