----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/949/#review959 -----------------------------------------------------------
trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java <https://reviews.apache.org/r/949/#comment2036> If location already exists then create db will fail. This differs from create table semantics, where if location already exists then create table succeeds. I think we should follow create table in both semantics as well as code-wise, which does as follows: if (!wh.isDir(tblPath)) { if (!wh.mkdirs(tblPath)) { throw new MetaException(tblPath + " is not a directory or unable to create one"); } madeDir = true; } Also note that fs operations are done within transaction. w.r.t deprecation Vs deletion of path api, I agree with Thiruvel's analysis, that its best to delete the api, since the old one will be buggy with these changes and also then there will be multiple ways to get path which will be confusing. - Ashutosh On 2011-06-29 11:17:50, Thiruvel Thirumoolan wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/949/ > ----------------------------------------------------------- > > (Updated 2011-06-29 11:17:50) > > > Review request for hive, Ning Zhang and Amareshwari Sriramadasu. > > > Summary > ------- > > Usage: > > create database location 'path1'; > alter database location 'path2'; > > After 'alter', only newly created tables will be located under the new > location. Tables created before 'alter' will be under 'path1'. > > Notes: > ------ > 1. I have moved getDefaultDatabasePath() to HiveMetaStore and made it > private. There should only be one API to obtain the location of a database > and it has to accept 'Database' as an arg and hence the new method in > Warehouse 'getDatabasePath()' and similarly 'getTablePath()'. The usages of > older API also has been changed. Hope that should be fine. > 2. One could argue why have getDatabasePath() as location can be obtained by > db.getLocationUri(). I wanted to retain this method to do any additional > processing if necessary (getDns or whatever). > > > This addresses bug HIVE-1537. > https://issues.apache.org/jira/browse/HIVE-1537 > > > Diffs > ----- > > > trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveAlterHandler.java > 1140495 > > trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java > 1140495 > trunk/metastore/src/java/org/apache/hadoop/hive/metastore/Warehouse.java > 1140495 > > trunk/metastore/src/test/org/apache/hadoop/hive/metastore/TestHiveMetaStore.java > 1140495 > trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/StatsTask.java 1140495 > trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java > 1140495 > trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/Hive.g 1140495 > > trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/ImportSemanticAnalyzer.java > 1140495 > trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java > 1140495 > trunk/ql/src/test/org/apache/hadoop/hive/ql/metadata/TestHive.java 1140495 > trunk/ql/src/test/queries/clientpositive/database_location.q PRE-CREATION > trunk/ql/src/test/results/clientpositive/database_location.q.out > PRE-CREATION > > Diff: https://reviews.apache.org/r/949/diff > > > Testing > ------- > > 1. Updated TestHiveMetaStore.java for testing the functionality - database > creation, alteration and table's locations as TestCliDriver outputs ignore > locations. > 2. Added database_location.q for testing the grammar primarily. > > Thanks, > Thiruvel > > > Thanks, > > Thiruvel > >