You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kyuubi.apache.org by ch...@apache.org on 2023/02/24 05:36:24 UTC

[kyuubi] branch branch-1.7 updated: [KYUUBI #4406] Revert "[KYUUBI #4305][Bug] Backport HIVE-15820: comment at the head …

This is an automated email from the ASF dual-hosted git repository.

chengpan pushed a commit to branch branch-1.7
in repository https://gitbox.apache.org/repos/asf/kyuubi.git


The following commit(s) were added to refs/heads/branch-1.7 by this push:
     new 962ccf694 [KYUUBI #4406] Revert "[KYUUBI #4305][Bug] Backport HIVE-15820: comment at the head …
962ccf694 is described below

commit 962ccf694a6a60ae019ec4c55c31239e90a6e8cb
Author: Fu Chen <cf...@gmail.com>
AuthorDate: Fri Feb 24 13:35:36 2023 +0800

    [KYUUBI #4406] Revert "[KYUUBI #4305][Bug] Backport HIVE-15820: comment at the head …
    
    …of beeline -e"
    
    This reverts commit c489e29697c73e3eec96aa3ff602e40f9a2c798a.
    
    ### _Why are the changes needed?_
    
    https://github.com/apache/kyuubi/pull/4333#issuecomment-1441438302
    
    ### _How was this patch tested?_
    - [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible
    
    - [ ] Add screenshots for manual tests if appropriate
    
    - [ ] [Run test](https://kyuubi.readthedocs.io/en/master/develop_tools/testing.html#running-tests) locally before make a pull request
    
    Closes #4406 from cfmcgrady/revert-4333.
    
    Closes #4406
    
    Closes #4305
    
    c7fff72a [Fu Chen] Revert "[KYUUBI #4305][Bug] Backport HIVE-15820: comment at the head of beeline -e"
    
    Authored-by: Fu Chen <cf...@gmail.com>
    Signed-off-by: Cheng Pan <ch...@apache.org>
    (cherry picked from commit b39caed98f56d5d99dca2a07eb3aa1c56d2ffb88)
    Signed-off-by: Cheng Pan <ch...@apache.org>
---
 .../main/java/org/apache/hive/beeline/KyuubiBeeLine.java    |  6 ------
 .../main/java/org/apache/hive/beeline/KyuubiCommands.java   |  6 ++----
 .../java/org/apache/hive/beeline/KyuubiBeeLineTest.java     | 13 -------------
 3 files changed, 2 insertions(+), 23 deletions(-)

diff --git a/kyuubi-hive-beeline/src/main/java/org/apache/hive/beeline/KyuubiBeeLine.java b/kyuubi-hive-beeline/src/main/java/org/apache/hive/beeline/KyuubiBeeLine.java
index 92b96ccb4..7ca767148 100644
--- a/kyuubi-hive-beeline/src/main/java/org/apache/hive/beeline/KyuubiBeeLine.java
+++ b/kyuubi-hive-beeline/src/main/java/org/apache/hive/beeline/KyuubiBeeLine.java
@@ -29,7 +29,6 @@ import java.util.List;
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.Options;
 import org.apache.commons.cli.ParseException;
-import org.apache.hive.common.util.HiveStringUtils;
 
 public class KyuubiBeeLine extends BeeLine {
   public static final String KYUUBI_BEELINE_DEFAULT_JDBC_DRIVER =
@@ -193,9 +192,4 @@ public class KyuubiBeeLine extends BeeLine {
     }
     return code;
   }
-
-  @Override
-  boolean dispatch(String line) {
-    return super.dispatch(HiveStringUtils.removeComments(line));
-  }
 }
diff --git a/kyuubi-hive-beeline/src/main/java/org/apache/hive/beeline/KyuubiCommands.java b/kyuubi-hive-beeline/src/main/java/org/apache/hive/beeline/KyuubiCommands.java
index 1a15638f1..aaa32739a 100644
--- a/kyuubi-hive-beeline/src/main/java/org/apache/hive/beeline/KyuubiCommands.java
+++ b/kyuubi-hive-beeline/src/main/java/org/apache/hive/beeline/KyuubiCommands.java
@@ -23,7 +23,6 @@ import java.io.*;
 import java.sql.*;
 import java.util.*;
 import org.apache.hive.beeline.logs.KyuubiBeelineInPlaceUpdateStream;
-import org.apache.hive.common.util.HiveStringUtils;
 import org.apache.kyuubi.jdbc.hive.KyuubiStatement;
 import org.apache.kyuubi.jdbc.hive.Utils;
 import org.apache.kyuubi.jdbc.hive.logs.InPlaceUpdateStream;
@@ -500,7 +499,7 @@ public class KyuubiCommands extends Commands {
 
   @Override
   public String handleMultiLineCmd(String line) throws IOException {
-    line = HiveStringUtils.removeComments(line);
+    int[] startQuote = {-1};
     Character mask =
         (System.getProperty("jline.terminal", "").equals("jline.UnsupportedTerminal"))
             ? null
@@ -531,8 +530,7 @@ public class KyuubiCommands extends Commands {
       if (extra == null) { // it happens when using -f and the line of cmds does not end with ;
         break;
       }
-      extra = HiveStringUtils.removeComments(extra);
-      if (extra != null && !extra.isEmpty()) {
+      if (!extra.isEmpty()) {
         line += "\n" + extra;
       }
     }
diff --git a/kyuubi-hive-beeline/src/test/java/org/apache/hive/beeline/KyuubiBeeLineTest.java b/kyuubi-hive-beeline/src/test/java/org/apache/hive/beeline/KyuubiBeeLineTest.java
index d571d9362..b144c95c6 100644
--- a/kyuubi-hive-beeline/src/test/java/org/apache/hive/beeline/KyuubiBeeLineTest.java
+++ b/kyuubi-hive-beeline/src/test/java/org/apache/hive/beeline/KyuubiBeeLineTest.java
@@ -29,17 +29,4 @@ public class KyuubiBeeLineTest {
     int result = kyuubiBeeLine.initArgs(new String[0]);
     assertEquals(0, result);
   }
-
-  @Test
-  public void testKyuubiBeelineComment() {
-    KyuubiBeeLine kyuubiBeeLine = new KyuubiBeeLine();
-    int result = kyuubiBeeLine.initArgsFromCliVars(new String[] {"-e", "--comment show database;"});
-    assertEquals(0, result);
-    result = kyuubiBeeLine.initArgsFromCliVars(new String[] {"-e", "--comment\n show database;"});
-    assertEquals(1, result);
-    result =
-        kyuubiBeeLine.initArgsFromCliVars(
-            new String[] {"-e", "--comment line 1 \n    --comment line 2 \n show database;"});
-    assertEquals(1, result);
-  }
 }