You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by br...@apache.org on 2014/11/22 20:10:05 UTC
svn commit: r1641104 -
/hive/trunk/beeline/src/java/org/apache/hive/beeline/SQLCompleter.java
Author: brock
Date: Sat Nov 22 19:10:05 2014
New Revision: 1641104
URL: http://svn.apache.org/r1641104
Log:
HIVE-8825 - SQLCompletor catches Throwable and ignores it (Ferdinand Xu via Brock)
Modified:
hive/trunk/beeline/src/java/org/apache/hive/beeline/SQLCompleter.java
Modified: hive/trunk/beeline/src/java/org/apache/hive/beeline/SQLCompleter.java
URL: http://svn.apache.org/viewvc/hive/trunk/beeline/src/java/org/apache/hive/beeline/SQLCompleter.java?rev=1641104&r1=1641103&r2=1641104&view=diff
==============================================================================
--- hive/trunk/beeline/src/java/org/apache/hive/beeline/SQLCompleter.java (original)
+++ hive/trunk/beeline/src/java/org/apache/hive/beeline/SQLCompleter.java Sat Nov 22 19:10:05 2014
@@ -31,8 +31,12 @@ import java.util.StringTokenizer;
import java.util.TreeSet;
import jline.console.completer.StringsCompleter;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
class SQLCompleter extends StringsCompleter {
+ private static final Log LOG = LogFactory.getLog(SQLCompleter.class.getName());
+
public SQLCompleter(Set<String> completions){
super(completions);
@@ -50,23 +54,33 @@ class SQLCompleter extends StringsComple
// now add the keywords from the current connection
try {
keywords += "," + beeLine.getDatabaseConnection().getDatabaseMetaData().getSQLKeywords();
- } catch (Throwable t) {
+ } catch (Exception e) {
+ LOG.debug("fail to get SQL key words from database metadata due to the exception: " + e, e);
}
try {
keywords += "," + beeLine.getDatabaseConnection().getDatabaseMetaData().getStringFunctions();
- } catch (Throwable t) {
+ } catch (Exception e) {
+ LOG.debug(
+ "fail to get string function names from database metadata due to the exception: " + e, e);
}
try {
keywords += "," + beeLine.getDatabaseConnection().getDatabaseMetaData().getNumericFunctions();
- } catch (Throwable t) {
+ } catch (Exception e) {
+ LOG.debug(
+ "fail to get numeric function names from database metadata due to the exception: " + e, e);
}
try {
keywords += "," + beeLine.getDatabaseConnection().getDatabaseMetaData().getSystemFunctions();
- } catch (Throwable t) {
+ } catch (Exception e) {
+ LOG.debug(
+ "fail to get system function names from database metadata due to the exception: " + e, e);
}
try {
keywords += "," + beeLine.getDatabaseConnection().getDatabaseMetaData().getTimeDateFunctions();
- } catch (Throwable t) {
+ } catch (Exception e) {
+ LOG.debug(
+ "fail to get time date function names from database metadata due to the exception: " + e,
+ e);
}
// also allow lower-case versions of all the keywords