diff --git a/beeline/src/java/org/apache/hive/beeline/BeeLine.java b/beeline/src/java/org/apache/hive/beeline/BeeLine.java index 7c53997..5a22956 100644 --- a/beeline/src/java/org/apache/hive/beeline/BeeLine.java +++ b/beeline/src/java/org/apache/hive/beeline/BeeLine.java @@ -827,6 +827,9 @@ public int begin(String[] args, InputStream inputStream) throws IOException { return code; } getOpts().updateBeeLineOptsFromConf(); + getOpts().setShowHeader(false); + getOpts().setOutputFormat("dsv"); + getOpts().setDelimiterForDSV(' '); } if (getOpts().getScriptFile() != null) { diff --git a/beeline/src/test/org/apache/hive/beeline/cli/TestHiveCli.java b/beeline/src/test/org/apache/hive/beeline/cli/TestHiveCli.java index fa94c89..ed4e7c6 100644 --- a/beeline/src/test/org/apache/hive/beeline/cli/TestHiveCli.java +++ b/beeline/src/test/org/apache/hive/beeline/cli/TestHiveCli.java @@ -41,11 +41,11 @@ private static final int ERRNO_OTHER = 2; private final static String SOURCE_CONTEXT = - "create table if not exists test.testSrcTbl(a string, b string);"; + "create table if not exists test.testSrcTbl(sc1 string);"; private final static String SOURCE_CONTEXT2 = - "create table if not exists test.testSrcTbl2(a string);"; + "create table if not exists test.testSrcTbl2(sc2 string);"; private final static String SOURCE_CONTEXT3 = - "create table if not exists test.testSrcTbl3(a string);"; + "create table if not exists test.testSrcTbl3(sc3 string);"; final static String CMD = "create database if not exists test;\ncreate table if not exists test.testTbl(a string, b " + "string);\n"; @@ -107,7 +107,7 @@ public void testDatabaseOptions() { @Test public void testSourceCmd() { File f = generateTmpFile(SOURCE_CONTEXT); - verifyCMD("source " + f.getPath() + ";" + "desc testSrcTbl;\nquit;\n", "col_name", os, + verifyCMD("source " + f.getPath() + ";" + "desc testSrcTbl;\nquit;\n", "sc1", os, new String[] { "--database", "test" }, ERRNO_OK); f.delete(); } @@ -115,7 +115,7 @@ public void testSourceCmd() { @Test public void testSourceCmd2() { File f = generateTmpFile(SOURCE_CONTEXT3); - verifyCMD("source " + f.getPath() + ";" + "desc testSrcTbl3;\nquit;\n", "col_name", os, + verifyCMD("source " + f.getPath() + ";" + "desc testSrcTbl3;\nquit;\n", "sc3", os, new String[] { "--database", "test" }, ERRNO_OK); f.delete(); } @@ -153,7 +153,7 @@ public void testVariablesForSource() { File f = generateTmpFile(SOURCE_CONTEXT2); verifyCMD( "set hiveconf:zzz=" + f.getAbsolutePath() + ";\nsource ${hiveconf:zzz};\ndesc testSrcTbl2;", - "col_name", os, new String[] { "--database", "test" }, ERRNO_OK); + "sc2", os, new String[] { "--database", "test" }, ERRNO_OK); f.delete(); }