HIVE-14935: Add tests for beeline force option (Kavan Suresh via Jason Dere)
Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/df6afdd4 Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/df6afdd4 Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/df6afdd4 Branch: refs/heads/hive-14535 Commit: df6afdd4c1ef52f8c8af7a0425298b240230661b Parents: 8d3925f Author: Jason Dere <jd...@hortonworks.com> Authored: Mon Oct 17 11:03:29 2016 -0700 Committer: Jason Dere <jd...@hortonworks.com> Committed: Mon Oct 17 11:03:29 2016 -0700 ---------------------------------------------------------------------- .../org/apache/hive/beeline/TestBeeLineWithArgs.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hive/blob/df6afdd4/itests/hive-unit/src/test/java/org/apache/hive/beeline/TestBeeLineWithArgs.java ---------------------------------------------------------------------- diff --git a/itests/hive-unit/src/test/java/org/apache/hive/beeline/TestBeeLineWithArgs.java b/itests/hive-unit/src/test/java/org/apache/hive/beeline/TestBeeLineWithArgs.java index 1ca7623..9e99a91 100644 --- a/itests/hive-unit/src/test/java/org/apache/hive/beeline/TestBeeLineWithArgs.java +++ b/itests/hive-unit/src/test/java/org/apache/hive/beeline/TestBeeLineWithArgs.java @@ -911,4 +911,19 @@ public class TestBeeLineWithArgs { final String EXPECTED_PATTERN = "hello world"; testScriptFile(SCRIPT_TEXT, EXPECTED_PATTERN, true, argList,true,false); } + + /** + * Attempt to execute Beeline with force option to continue running script even after errors. + * Test for presence of an expected pattern to match the output of a valid command at the end. + */ + @Test + public void testBeelineWithForce() throws Throwable { + final String SCRIPT_TEXT = "drop table does_not_exist;\ncreate table incomplete_syntax(a, string, );\n " + + "drop table if exists new_table;\n create table new_table(foo int, bar string);\n " + + "desc new_table;\n"; + final String EXPECTED_PATTERN = "2 rows selected"; + List<String> argList = getBaseArgs(miniHS2.getBaseJdbcURL()); + argList.add("--force"); + testScriptFile(SCRIPT_TEXT, EXPECTED_PATTERN, true, argList); + } }