Author: brock Date: Fri Jan 9 17:37:27 2015 New Revision: 1650610 URL: http://svn.apache.org/r1650610 Log: HIVE-9329 - The qtest can't handle the statements which contains semicolons in qfile (Ferdinand Xu via Brock)
Modified: hive/branches/HIVE-8065/itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java Modified: hive/branches/HIVE-8065/itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java URL: http://svn.apache.org/viewvc/hive/branches/HIVE-8065/itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java?rev=1650610&r1=1650609&r2=1650610&view=diff ============================================================================== --- hive/branches/HIVE-8065/itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java (original) +++ hive/branches/HIVE-8065/itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java Fri Jan 9 17:37:27 2015 @@ -267,7 +267,7 @@ public class QTestUtil { // Plug verifying metastore in for testing. conf.setVar(HiveConf.ConfVars.METASTORE_RAW_STORE_IMPL, - "org.apache.hadoop.hive.metastore.VerifyingObjectStore"); + "org.apache.hadoop.hive.metastore.VerifyingObjectStore"); if (mr != null) { assert dfs != null; @@ -926,7 +926,18 @@ public class QTestUtil { String [] cmds = commands.split(";"); int rc = 0; - for (String command : cmds) { + String command = ""; + for (String oneCmd : cmds) { + if (StringUtils.endsWith(oneCmd, "\\")) { + command += StringUtils.chop(oneCmd) + "\\;"; + continue; + } else { + command += oneCmd; + } + if (StringUtils.isBlank(command)) { + continue; + } + if (isCommandUsedForTesting(command)) { rc = executeTestCommand(command); } else { @@ -936,6 +947,7 @@ public class QTestUtil { if (rc != 0) { break; } + command = ""; } return rc;