Repository: hive Updated Branches: refs/heads/branch-3 f80b2f405 -> 4a572f706
HIVE-19141 : TestNegativeCliDriver insert_into_notnull_constraint, insert_into_acid_notnull failing (Igor Kryvenko via Ashutosh Chauhan) Signed-off-by: Ashutosh Chauhan <hashut...@apache.org> Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/4a572f70 Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/4a572f70 Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/4a572f70 Branch: refs/heads/branch-3 Commit: 4a572f706f14a78da44e425bd667db09011ad3eb Parents: f80b2f4 Author: Igor Kryvenko <kryvenko7i...@gmail.com> Authored: Wed Apr 18 20:48:56 2018 -0700 Committer: Vineet Garg <vg...@apache.org> Committed: Fri Apr 20 13:55:40 2018 -0700 ---------------------------------------------------------------------- .../hive/cli/control/CoreNegativeCliDriver.java | 7 ++++++ .../org/apache/hadoop/hive/ql/QTestUtil.java | 26 ++++++++++++++++++++ .../check_constraint_violation.q.out | 1 + ..._constraint_invalid_default_value_type.q.out | 2 +- .../merge_constraint_notnull.q.out | 1 + 5 files changed, 36 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hive/blob/4a572f70/itests/util/src/main/java/org/apache/hadoop/hive/cli/control/CoreNegativeCliDriver.java ---------------------------------------------------------------------- diff --git a/itests/util/src/main/java/org/apache/hadoop/hive/cli/control/CoreNegativeCliDriver.java b/itests/util/src/main/java/org/apache/hadoop/hive/cli/control/CoreNegativeCliDriver.java index 0788b2d..176ac14 100644 --- a/itests/util/src/main/java/org/apache/hadoop/hive/cli/control/CoreNegativeCliDriver.java +++ b/itests/util/src/main/java/org/apache/hadoop/hive/cli/control/CoreNegativeCliDriver.java @@ -133,6 +133,13 @@ public class CoreNegativeCliDriver extends CliAdapter{ debugHint : "\r\n" + result.getCapturedOutput(); qt.failedDiff(result.getReturnCode(), fname, message); } + } catch (Error error) { + QTestProcessExecResult qTestProcessExecResult = qt.checkNegativeResults(fname, error); + if (qTestProcessExecResult.getReturnCode() != 0) { + String message = Strings.isNullOrEmpty(qTestProcessExecResult.getCapturedOutput()) ? debugHint : + "\r\n" + qTestProcessExecResult.getCapturedOutput(); + qt.failedDiff(qTestProcessExecResult.getReturnCode(), fname, message); + } } catch (Exception e) { qt.failed(e, fname, debugHint); http://git-wip-us.apache.org/repos/asf/hive/blob/4a572f70/itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java ---------------------------------------------------------------------- diff --git a/itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java b/itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java index a386284..527a49e 100644 --- a/itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java +++ b/itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java @@ -1617,6 +1617,32 @@ public class QTestUtil { return result; } + public QTestProcessExecResult checkNegativeResults(String tname, Error e) throws Exception { + + String outFileExtension = getOutFileExtension(tname); + + File qf = new File(outDir, tname); + String expf = outPath(outDir.toString(), tname.concat(outFileExtension)); + + File outf = null; + outf = new File(logDir); + outf = new File(outf, qf.getName().concat(outFileExtension)); + + FileWriter outfd = new FileWriter(outf, true); + + outfd + .write("FAILED: " + e.getClass().getSimpleName() + " " + e.getClass().getName() + ": " + e.getMessage() + "\n"); + outfd.close(); + + QTestProcessExecResult result = executeDiffCommand(outf.getPath(), expf, false, qSortSet.contains(qf.getName())); + if (overWrite) { + overwriteResults(outf.getPath(), expf); + return QTestProcessExecResult.createWithoutOutput(0); + } + + return result; + } + public QTestProcessExecResult checkParseResults(String tname, ASTNode tree) throws Exception { if (tree != null) { http://git-wip-us.apache.org/repos/asf/hive/blob/4a572f70/ql/src/test/results/clientnegative/check_constraint_violation.q.out ---------------------------------------------------------------------- diff --git a/ql/src/test/results/clientnegative/check_constraint_violation.q.out b/ql/src/test/results/clientnegative/check_constraint_violation.q.out index 82f367c..05e3ff5 100644 --- a/ql/src/test/results/clientnegative/check_constraint_violation.q.out +++ b/ql/src/test/results/clientnegative/check_constraint_violation.q.out @@ -11,4 +11,5 @@ PREHOOK: type: QUERY PREHOOK: Input: _dummy_database@_dummy_table PREHOOK: Output: default@tti #### A masked pattern was here #### +Error during job, obtaining debugging information... FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask http://git-wip-us.apache.org/repos/asf/hive/blob/4a572f70/ql/src/test/results/clientnegative/default_constraint_invalid_default_value_type.q.out ---------------------------------------------------------------------- diff --git a/ql/src/test/results/clientnegative/default_constraint_invalid_default_value_type.q.out b/ql/src/test/results/clientnegative/default_constraint_invalid_default_value_type.q.out index c60bc02..61e0a2f 100644 --- a/ql/src/test/results/clientnegative/default_constraint_invalid_default_value_type.q.out +++ b/ql/src/test/results/clientnegative/default_constraint_invalid_default_value_type.q.out @@ -1 +1 @@ -FAILED: SemanticException [Error 10326]: Invalid Constraint syntax Invalid Default value: UDFToString(year('1970-01-01')). DEFAULT only allows constant or function expressions +FAILED: SemanticException [Error 10326]: Invalid Constraint syntax Invalid Default value: cast(year("1970-01-01") as string). DEFAULT only allows constant or function expressions http://git-wip-us.apache.org/repos/asf/hive/blob/4a572f70/ql/src/test/results/clientnegative/merge_constraint_notnull.q.out ---------------------------------------------------------------------- diff --git a/ql/src/test/results/clientnegative/merge_constraint_notnull.q.out b/ql/src/test/results/clientnegative/merge_constraint_notnull.q.out index 088e249..0fd26ff 100644 --- a/ql/src/test/results/clientnegative/merge_constraint_notnull.q.out +++ b/ql/src/test/results/clientnegative/merge_constraint_notnull.q.out @@ -52,4 +52,5 @@ PREHOOK: Output: default@testt PREHOOK: Output: default@testt PREHOOK: Output: default@testt #### A masked pattern was here #### +Error during job, obtaining debugging information... FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask