diff --git a/hcatalog/src/test/e2e/templeton/tests/jobsubmission.conf b/hcatalog/src/test/e2e/templeton/tests/jobsubmission.conf index ad804cb..bfe2a6c 100644 --- a/hcatalog/src/test/e2e/templeton/tests/jobsubmission.conf +++ b/hcatalog/src/test/e2e/templeton/tests/jobsubmission.conf @@ -382,7 +382,7 @@ $cfg = 'num' => 7, 'method' => 'POST', 'url' => ':TEMPLETON_URL:/templeton/v1/hive', - 'post_options' => ['user.name=:UNAME:','execute=select a,b from mynums', ], + 'post_options' => ['user.name=:UNAME:','execute=select count(*) from mynums', ], 'json_field_substr_match' => { 'id' => '\d+'}, #results 'status_code' => 200, diff --git a/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/tool/TempletonUtils.java b/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/tool/TempletonUtils.java index a2ee1a0..0725976 100644 --- a/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/tool/TempletonUtils.java +++ b/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/tool/TempletonUtils.java @@ -89,7 +89,7 @@ public static boolean isset(char ch) { public static final Pattern JAR_COMPLETE = Pattern.compile(" map \\d+%\\s+reduce \\d+%$"); public static final Pattern PIG_COMPLETE = Pattern.compile(" \\d+% complete$"); //looking for map = 100%, reduce = 100% - public static final Pattern HIVE_COMPLETE = Pattern.compile(" map = \\d+%,\\s+reduce = \\d+%$"); + public static final Pattern HIVE_COMPLETE = Pattern.compile(" map = (\\d+%),\\s+reduce = (\\d+%).*$"); /** * Extract the percent complete line from Pig or Jar jobs. @@ -105,15 +105,7 @@ public static String extractPercentComplete(String line) { Matcher hive = HIVE_COMPLETE.matcher(line); if(hive.find()) { - StringBuilder sb = new StringBuilder(hive.group().trim()); - String[] toRemove = {"= ", ", "}; - for(String pattern : toRemove) { - int pos; - while((pos = sb.indexOf(pattern)) >= 0) { - sb.delete(pos, pos + pattern.length()); - } - } - return sb.toString();//normalized to look like JAR_COMPLETE + return "map " + hive.group(1) + " reduce " + hive.group(2); } return null; }