FAQ
Author: rhbutani
Date: Wed Mar 26 18:10:27 2014
New Revision: 1581975

URL: http://svn.apache.org/r1581975
Log:
HIVE-5768 Beeline connection cannot be closed with not close command (Navis Ryu via Brock Noland)

Modified:
     hive/branches/branch-0.13/beeline/src/java/org/apache/hive/beeline/BeeLine.java
     hive/branches/branch-0.13/beeline/src/java/org/apache/hive/beeline/Commands.java
     hive/branches/branch-0.13/beeline/src/main/resources/BeeLine.properties

Modified: hive/branches/branch-0.13/beeline/src/java/org/apache/hive/beeline/BeeLine.java
URL: http://svn.apache.org/viewvc/hive/branches/branch-0.13/beeline/src/java/org/apache/hive/beeline/BeeLine.java?rev=1581975&r1=1581974&r2=1581975&view=diff
==============================================================================
--- hive/branches/branch-0.13/beeline/src/java/org/apache/hive/beeline/BeeLine.java (original)
+++ hive/branches/branch-0.13/beeline/src/java/org/apache/hive/beeline/BeeLine.java Wed Mar 26 18:10:27 2014
@@ -779,19 +779,27 @@ public class BeeLine {
        for (int i = 0; i < commandHandlers.length; i++) {
          String match = commandHandlers[i].matches(line);
          if (match != null) {
- cmdMap.put(match, commandHandlers[i]);
+ CommandHandler prev = cmdMap.put(match, commandHandlers[i]);
+ if (prev != null) {
+ return error(loc("multiple-matches",
+ Arrays.asList(prev.getName(), commandHandlers[i].getName())));
+ }
          }
        }

        if (cmdMap.size() == 0) {
          return error(loc("unknown-command", line));
- } else if (cmdMap.size() > 1) {
- return error(loc("multiple-matches",
- cmdMap.keySet().toString()));
- } else {
- return cmdMap.values().iterator().next()
- .execute(line);
        }
+ if (cmdMap.size() > 1) {
+ // any exact match?
+ CommandHandler handler = cmdMap.get(line);
+ if (handler == null) {
+ return error(loc("multiple-matches", cmdMap.keySet().toString()));
+ }
+ return handler.execute(line);
+ }
+ return cmdMap.values().iterator().next()
+ .execute(line);
      } else {
        return commands.sql(line);
      }

Modified: hive/branches/branch-0.13/beeline/src/java/org/apache/hive/beeline/Commands.java
URL: http://svn.apache.org/viewvc/hive/branches/branch-0.13/beeline/src/java/org/apache/hive/beeline/Commands.java?rev=1581975&r1=1581974&r2=1581975&view=diff
==============================================================================
--- hive/branches/branch-0.13/beeline/src/java/org/apache/hive/beeline/Commands.java (original)
+++ hive/branches/branch-0.13/beeline/src/java/org/apache/hive/beeline/Commands.java Wed Mar 26 18:10:27 2014
@@ -801,8 +801,8 @@ public class Commands {
      try {
        if (beeLine.getDatabaseConnection().getConnection() != null
            && !(beeLine.getDatabaseConnection().getConnection().isClosed())) {
- beeLine.info(beeLine.loc("closing",
- beeLine.getDatabaseConnection().getConnection().getClass().getName()));
+ int index = beeLine.getDatabaseConnections().getIndex();
+ beeLine.info(beeLine.loc("closing", index, beeLine.getDatabaseConnection()));
          beeLine.getDatabaseConnection().getConnection().close();
        } else {
          beeLine.info(beeLine.loc("already-closed"));

Modified: hive/branches/branch-0.13/beeline/src/main/resources/BeeLine.properties
URL: http://svn.apache.org/viewvc/hive/branches/branch-0.13/beeline/src/main/resources/BeeLine.properties?rev=1581975&r1=1581974&r2=1581975&view=diff
==============================================================================
--- hive/branches/branch-0.13/beeline/src/main/resources/BeeLine.properties (original)
+++ hive/branches/branch-0.13/beeline/src/main/resources/BeeLine.properties Wed Mar 26 18:10:27 2014
@@ -80,7 +80,7 @@ scanning: Scanning {0}...
  no-such-method: No such method "{0}"
  possible-methods: Possible methods:

-closing: Closing: {0}
+closing: Closing: {0}: {1}
  already-closed: Connection is already closed.
  error-setting: Error setting configuration: {0}: {1}
  no-method: No method matching "{0}" was found in {1}.

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcommits @
categorieshive, hadoop
postedMar 26, '14 at 6:10p
activeMar 26, '14 at 6:10p
posts1
users1
websitehive.apache.org

1 user in discussion

Rhbutani: 1 post

People

Translate

site design / logo © 2021 Grokbase