hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aihu...@apache.org
Subject hive git commit: HIVE-11828: beeline -f fails on scripts with tabs between column type and comment (Aihua Xu, reviewed by Yongzhi Chen)
Date Mon, 11 Jan 2016 15:43:30 GMT
Repository: hive
Updated Branches:
  refs/heads/master ef34c818f -> 358691a43


HIVE-11828: beeline -f fails on scripts with tabs between column type and comment (Aihua Xu,
reviewed by Yongzhi Chen)


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/358691a4
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/358691a4
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/358691a4

Branch: refs/heads/master
Commit: 358691a4301dc873251b8c220f13808012bf9b61
Parents: ef34c81
Author: Aihua Xu <aihuaxu@apache.org>
Authored: Wed Jan 6 16:29:54 2016 -0500
Committer: Aihua Xu <aihuaxu@apache.org>
Committed: Mon Jan 11 10:42:05 2016 -0500

----------------------------------------------------------------------
 beeline/src/java/org/apache/hive/beeline/BeeLine.java        | 1 +
 .../java/org/apache/hive/beeline/TestBeeLineWithArgs.java    | 8 ++++++++
 2 files changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/358691a4/beeline/src/java/org/apache/hive/beeline/BeeLine.java
----------------------------------------------------------------------
diff --git a/beeline/src/java/org/apache/hive/beeline/BeeLine.java b/beeline/src/java/org/apache/hive/beeline/BeeLine.java
index 1e289ca..f7399bc 100644
--- a/beeline/src/java/org/apache/hive/beeline/BeeLine.java
+++ b/beeline/src/java/org/apache/hive/beeline/BeeLine.java
@@ -988,6 +988,7 @@ public class BeeLine implements Closeable {
       InputStream inputStreamAppendedNewline = new SequenceInputStream(inputStream,
           new ByteArrayInputStream((new String("\n")).getBytes()));
       consoleReader = new ConsoleReader(inputStreamAppendedNewline, getOutputStream());
+      consoleReader.setCopyPasteDetection(true); // jline will detect if <tab> is regular
character
     } else {
       consoleReader = new ConsoleReader();
     }

http://git-wip-us.apache.org/repos/asf/hive/blob/358691a4/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 d5f692b..8475a89 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
@@ -323,6 +323,14 @@ public class TestBeeLineWithArgs {
   }
 
   @Test
+  public void testTabInScriptFile() throws Throwable {
+    List<String> argList = getBaseArgs(miniHS2.getBaseJdbcURL());
+    final String SCRIPT_TEXT = "CREATE\tTABLE IF NOT EXISTS testTabInScriptFile\n(id\tint);\nSHOW
TABLES;";
+    final String EXPECTED_PATTERN = "testTabInScriptFile";
+    testScriptFile(SCRIPT_TEXT, EXPECTED_PATTERN, true, argList);
+  }
+
+  @Test
   public void testBeelineShellCommand() throws Throwable {
     List<String> argList = getBaseArgs(miniHS2.getBaseJdbcURL());
     final String SCRIPT_TEXT = "!sh echo \"hello world.\" > hw.txt\n!sh cat hw.txt\n!rm
hw.txt";


Mime
View raw message