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/01/22 07:26:56 UTC

svn commit: r902007 - in /hadoop/hive/trunk: ./ ql/src/java/org/apache/hadoop/hive/ql/exec/ ql/src/test/queries/clientnegative/ ql/src/test/results/clientnegative/

Author: zshao
Date: Fri Jan 22 06:26:53 2010
New Revision: 902007

URL: http://svn.apache.org/viewvc?rev=902007&view=rev
Log:
HIVE-1072. Show table extended to error out when the partition does not exist. (Yongqiang He via zshao)

Added:
    hadoop/hive/trunk/ql/src/test/queries/clientnegative/show_tablestatus_not_existing_part.q
    hadoop/hive/trunk/ql/src/test/results/clientnegative/show_tablestatus_not_existing_part.q.out
Modified:
    hadoop/hive/trunk/CHANGES.txt
    hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java

Modified: hadoop/hive/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/CHANGES.txt?rev=902007&r1=902006&r2=902007&view=diff
==============================================================================
--- hadoop/hive/trunk/CHANGES.txt (original)
+++ hadoop/hive/trunk/CHANGES.txt Fri Jan 22 06:26:53 2010
@@ -53,6 +53,9 @@
     HIVE-1075. Make it possible for users to recover data when moveTask fails
     (Zheng Shao via Ning Zhang)
 
+    HIVE-1072. Show table extended to error out when the partition does not exist.
+    (Yongqiang He via zshao)
+
 Release 0.5.0 -  Unreleased
 
   INCOMPATIBLE CHANGES

Modified: hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java?rev=902007&r1=902006&r2=902007&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java (original)
+++ hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java Fri Jan 22 06:26:53 2010
@@ -574,6 +574,10 @@
       Table tbl = db.getTable(showTblStatus.getDbName(), showTblStatus
           .getPattern());
       par = db.getPartition(tbl, part, false);
+      if (par == null) {
+        throw new HiveException("Partition " + part + " for table "
+            + showTblStatus.getPattern() + " does not exist.");
+      }
       tbls.add(tbl);
     } else {
       LOG.info("pattern: " + showTblStatus.getPattern());

Added: hadoop/hive/trunk/ql/src/test/queries/clientnegative/show_tablestatus_not_existing_part.q
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/test/queries/clientnegative/show_tablestatus_not_existing_part.q?rev=902007&view=auto
==============================================================================
--- hadoop/hive/trunk/ql/src/test/queries/clientnegative/show_tablestatus_not_existing_part.q (added)
+++ hadoop/hive/trunk/ql/src/test/queries/clientnegative/show_tablestatus_not_existing_part.q Fri Jan 22 06:26:53 2010
@@ -0,0 +1 @@
+SHOW TABLE EXTENDED LIKE `srcpart` PARTITION(ds='2008-14-08', hr=11);
\ No newline at end of file

Added: hadoop/hive/trunk/ql/src/test/results/clientnegative/show_tablestatus_not_existing_part.q.out
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/test/results/clientnegative/show_tablestatus_not_existing_part.q.out?rev=902007&view=auto
==============================================================================
--- hadoop/hive/trunk/ql/src/test/results/clientnegative/show_tablestatus_not_existing_part.q.out (added)
+++ hadoop/hive/trunk/ql/src/test/results/clientnegative/show_tablestatus_not_existing_part.q.out Fri Jan 22 06:26:53 2010
@@ -0,0 +1,4 @@
+PREHOOK: query: SHOW TABLE EXTENDED LIKE `srcpart` PARTITION(ds='2008-14-08', hr=11)
+PREHOOK: type: SHOW_TABLESTATUS
+FAILED: Error in metadata: Partition {ds=2008-14-08, hr=11} for table srcpart does not exist.
+FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask