You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by zs...@apache.org on 2010/02/10 21:15:33 UTC

svn commit: r908656 - in /hadoop/hive/trunk: CHANGES.txt metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java

Author: zshao
Date: Wed Feb 10 20:14:57 2010
New Revision: 908656

URL: http://svn.apache.org/viewvc?rev=908656&view=rev
Log:
HIVE-1150. Add comment to explain why we check for dir first in add_partitions(). (Paul Yang via zshao)

Modified:
    hadoop/hive/trunk/CHANGES.txt
    hadoop/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java

Modified: hadoop/hive/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/CHANGES.txt?rev=908656&r1=908655&r2=908656&view=diff
==============================================================================
--- hadoop/hive/trunk/CHANGES.txt (original)
+++ hadoop/hive/trunk/CHANGES.txt Wed Feb 10 20:14:57 2010
@@ -66,6 +66,9 @@
 
     HIVE-1123. Checkstyle fixes. (Carl Steinbach via zshao)
 
+    HIVE-1150. Add comment to explain why we check for dir first in add_partitions().
+    (Paul Yang via zshao)
+
   OPTIMIZATIONS
 
   BUG FIXES

Modified: hadoop/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java?rev=908656&r1=908655&r2=908656&view=diff
==============================================================================
--- hadoop/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java (original)
+++ hadoop/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java Wed Feb 10 20:14:57 2010
@@ -570,6 +570,9 @@
 
         part.getSd().setLocation(partLocation.toString());
 
+        // Check to see if the directory already exists before calling mkdirs()
+        // because if the file system is read-only, mkdirs will throw an  
+        // exception even if the directory already exists.
         if (!wh.isDir(partLocation)) {
           if (!wh.mkdirs(partLocation)) {
             throw new MetaException(partLocation