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

ayushtkn pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git


The following commit(s) were added to refs/heads/master by this push:
     new fcb717da45a HIVE-30022: Hive CLI fails with NullPointerException when 
USE_BEELINE_FOR_HIVE_CLI=false (#6762)
fcb717da45a is described below

commit fcb717da45a4eacb6e44ac05d488294603312d53
Author: Sercan Tekin <[email protected]>
AuthorDate: Fri Oct 2 21:48:51 2026 +0300

    HIVE-30022: Hive CLI fails with NullPointerException when 
USE_BEELINE_FOR_HIVE_CLI=false (#6762)
---
 bin/hive                                               |  2 +-
 cli/src/java/org/apache/hadoop/hive/cli/CliDriver.java | 11 +++++++++--
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/bin/hive b/bin/hive
index 41ba504d8a5..ec57bf98a39 100755
--- a/bin/hive
+++ b/bin/hive
@@ -88,7 +88,7 @@ if [ "$SERVICE" = "" ] ; then
   fi
 fi
 
-USE_BEELINE_FOR_HIVE_CLI="true"
+USE_BEELINE_FOR_HIVE_CLI="${USE_BEELINE_FOR_HIVE_CLI:-true}"
 if [[ "$SERVICE" == "cli" && "$USE_BEELINE_FOR_HIVE_CLI" == "true" ]] ; then
   CLIUSER=`whoami`
   SERVICE="beeline"
diff --git a/cli/src/java/org/apache/hadoop/hive/cli/CliDriver.java 
b/cli/src/java/org/apache/hadoop/hive/cli/CliDriver.java
index dddab3a23d7..351c16adfd9 100644
--- a/cli/src/java/org/apache/hadoop/hive/cli/CliDriver.java
+++ b/cli/src/java/org/apache/hadoop/hive/cli/CliDriver.java
@@ -842,7 +842,7 @@ private CommandProcessorResponse 
executeDriver(CliSessionState ss, HiveConf conf
       console.printInfo(HiveConf.generateMrDeprecationWarning());
     }
 
-    setupLineReader();
+    cli.setupLineReader();
 
     String line;
     CommandProcessorResponse response = new CommandProcessorResponse();
@@ -851,7 +851,7 @@ private CommandProcessorResponse 
executeDriver(CliSessionState ss, HiveConf conf
     String curPrompt = prompt + curDB;
     String dbSpaces = spacesForString(curDB);
 
-    while ((line = reader.readLine(curPrompt + "> ")) != null) {
+    while ((line = cli.readLine(curPrompt + "> ")) != null) {
       if (!prefix.toString().equals("")) {
         prefix.append('\n');
       }
@@ -923,6 +923,13 @@ protected void setupLineReader() throws IOException {
     reader = builder.build();
   }
 
+  /**
+   * Reads a line from the interactive command line without exposing the 
underlying reader.
+   */
+  private String readLine(String prompt) {
+    return reader.readLine(prompt);
+  }
+
   static DefaultParser getDefaultParser() {
     return new DefaultParser() {
       @Override

Reply via email to