use of org.apache.hadoop.hive.ql.processors.CommandProcessorException in project hive by apache.
the class CoreAccumuloCliDriver method runTest.
@Override
public void runTest(String tname, String fname, String fpath) {
long startTime = System.currentTimeMillis();
try {
System.err.println("Begin query: " + fname);
qt.setInputFile(fpath);
qt.cliInit();
try {
qt.executeClient();
} catch (CommandProcessorException e) {
qt.failedQuery(e.getCause(), e.getResponseCode(), fname, null);
}
QTestProcessExecResult result = qt.checkCliDriverResults();
if (result.getReturnCode() != 0) {
qt.failedDiff(result.getReturnCode(), fname, result.getCapturedOutput());
}
qt.clearPostTestEffects();
} catch (AssumptionViolatedException e) {
throw e;
} catch (Exception e) {
qt.failedWithException(e, fname, null);
}
long elapsedTime = System.currentTimeMillis() - startTime;
System.err.println("Done query: " + fname + " elapsedTime=" + elapsedTime / 1000 + "s");
assertTrue("Test passed", true);
}
use of org.apache.hadoop.hive.ql.processors.CommandProcessorException in project hive by apache.
the class CoreCliDriver method runTest.
@Override
public void runTest(String testName, String fname, String fpath) {
Stopwatch sw = Stopwatch.createStarted();
boolean skipped = false;
boolean failed = false;
try {
LOG.info("Begin query: " + fname);
System.err.println("Begin query: " + fname);
qt.setInputFile(fpath);
qt.cliInit();
try {
qt.executeClient();
} catch (CommandProcessorException e) {
failed = true;
qt.failedQuery(e.getCause(), e.getResponseCode(), fname, QTestUtil.DEBUG_HINT);
}
setupAdditionalPartialMasks();
QTestProcessExecResult result = qt.checkCliDriverResults();
resetAdditionalPartialMasks();
if (result.getReturnCode() != 0) {
failed = true;
String message = Strings.isNullOrEmpty(result.getCapturedOutput()) ? QTestUtil.DEBUG_HINT : "\r\n" + result.getCapturedOutput();
qt.failedDiff(result.getReturnCode(), fname, message);
}
} catch (AssumptionViolatedException e) {
skipped = true;
throw e;
} catch (Exception e) {
failed = true;
qt.failedWithException(e, fname, QTestUtil.DEBUG_HINT);
} finally {
String message = "Done query " + fname + ". succeeded=" + !failed + ", skipped=" + skipped + ". ElapsedTime(ms)=" + sw.stop().elapsed(TimeUnit.MILLISECONDS);
LOG.info(message);
System.err.println(message);
}
assertTrue("Test passed", true);
}
use of org.apache.hadoop.hive.ql.processors.CommandProcessorException in project hive by apache.
the class CoreHBaseNegativeCliDriver method runTest.
@Override
public void runTest(String tname, String fname, String fpath) {
long startTime = System.currentTimeMillis();
try {
System.err.println("Begin query: " + fname);
qt.setInputFile(fpath);
qt.cliInit();
try {
qt.executeClient();
qt.failed(fname, null);
} catch (CommandProcessorException e) {
// this is the expected result
}
QTestProcessExecResult result = qt.checkCliDriverResults();
if (result.getReturnCode() != 0) {
qt.failedDiff(result.getReturnCode(), fname, result.getCapturedOutput());
}
} catch (Exception e) {
qt.failedWithException(e, fname, null);
}
long elapsedTime = System.currentTimeMillis() - startTime;
System.err.println("Done query: " + fname + " elapsedTime=" + elapsedTime / 1000 + "s");
assertTrue("Test passed", true);
}
use of org.apache.hadoop.hive.ql.processors.CommandProcessorException in project hive by apache.
the class CorePerfCliDriver method runTest.
@Override
public void runTest(String name, String fname, String fpath) {
long startTime = System.currentTimeMillis();
try {
LOG.info("Begin query: " + fname);
qt.setInputFile(fpath);
qt.cliInit();
try {
qt.executeClient();
} catch (CommandProcessorException e) {
qt.failedQuery(e.getCause(), e.getResponseCode(), fname, QTestUtil.DEBUG_HINT);
}
QTestProcessExecResult result = qt.checkCliDriverResults();
if (result.getReturnCode() != 0) {
String message = Strings.isNullOrEmpty(result.getCapturedOutput()) ? QTestUtil.DEBUG_HINT : "\r\n" + result.getCapturedOutput();
qt.failedDiff(result.getReturnCode(), fname, message);
}
} catch (AssumptionViolatedException e) {
throw e;
} catch (Exception e) {
qt.failedWithException(e, fname, QTestUtil.DEBUG_HINT);
}
long elapsedTime = System.currentTimeMillis() - startTime;
LOG.info("Done query: " + fname + " elapsedTime=" + elapsedTime / 1000 + "s");
}
use of org.apache.hadoop.hive.ql.processors.CommandProcessorException in project hive by apache.
the class QTestDatasetHandler method initDataset.
public boolean initDataset(String table, CliDriver cliDriver) throws Exception {
File tableFile = new File(new File(datasetDir, table), Dataset.INIT_FILE_NAME);
String commands = null;
try {
commands = FileUtils.readFileToString(tableFile);
} catch (IOException e) {
throw new RuntimeException(String.format("dataset file not found %s", tableFile), e);
}
try {
CommandProcessorResponse result = cliDriver.processLine(commands);
LOG.info("Result from cliDrriver.processLine in initFromDatasets=" + result);
} catch (CommandProcessorException e) {
Assert.fail("Failed during initFromDatasets processLine with code=" + e);
}
return true;
}
Aggregations