You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by br...@apache.org on 2013/10/23 16:59:30 UTC

svn commit: r1535045 - in /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec: PartitionKeySampler.java mr/ExecDriver.java

Author: brock
Date: Wed Oct 23 14:59:29 2013
New Revision: 1535045

URL: http://svn.apache.org/r1535045
Log:
HIVE-5350 - Cleanup exception handling around parallel orderby (Navis via Brock Noland)

Modified:
    hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/PartitionKeySampler.java
    hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/mr/ExecDriver.java

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/PartitionKeySampler.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/PartitionKeySampler.java?rev=1535045&r1=1535044&r2=1535045&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/PartitionKeySampler.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/PartitionKeySampler.java Wed Oct 23 14:59:29 2013
@@ -120,7 +120,7 @@ public class PartitionKeySampler impleme
     int sampleNum = conf.getIntVar(HiveConf.ConfVars.HIVESAMPLINGNUMBERFORORDERBY);
     float samplePercent = conf.getFloatVar(HiveConf.ConfVars.HIVESAMPLINGPERCENTFORORDERBY);
     if (samplePercent < 0.0 || samplePercent > 1.0) {
-      throw new RuntimeException("Percentile value must be within the range of 0 to 1.");
+      throw new IllegalArgumentException("Percentile value must be within the range of 0 to 1.");
     }
     FetchSampler sampler = new FetchSampler(work, job, operator);
     sampler.setSampleNum(sampleNum);

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/mr/ExecDriver.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/mr/ExecDriver.java?rev=1535045&r1=1535044&r2=1535045&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/mr/ExecDriver.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/mr/ExecDriver.java Wed Oct 23 14:59:29 2013
@@ -387,10 +387,16 @@ public class ExecDriver extends Task<Map
         try {
           handleSampling(driverContext, mWork, job, conf);
           job.setPartitionerClass(HiveTotalOrderPartitioner.class);
-        } catch (Exception e) {
+        } catch (IllegalStateException e) {
           console.printInfo("Not enough sampling data.. Rolling back to single reducer task");
           rWork.setNumReduceTasks(1);
           job.setNumReduceTasks(1);
+        } catch (Exception e) {
+          LOG.error("Sampling error", e);
+          console.printError(e.toString(),
+              "\n" + org.apache.hadoop.util.StringUtils.stringifyException(e));
+          rWork.setNumReduceTasks(1);
+          job.setNumReduceTasks(1);
         }
       }