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 92b96ccb436..7ca7671486b 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 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 @@ int initArgs(String[] args) { } 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 1a15638f1a6..aaa32739acd 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.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 boolean connect(Properties props) throws IOException { @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 String handleMultiLineCmd(String line) throws IOException { 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 d571d93620b..b144c95c61f 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 void testKyuubiBeelineWithoutArgs() { 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); - } }