diff --git beeline/src/java/org/apache/hive/beeline/SQLCompleter.java beeline/src/java/org/apache/hive/beeline/SQLCompleter.java index 3f2f7b0..6d7d456 100644 --- beeline/src/java/org/apache/hive/beeline/SQLCompleter.java +++ beeline/src/java/org/apache/hive/beeline/SQLCompleter.java @@ -31,8 +31,12 @@ 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 completions){ super(completions); @@ -51,22 +55,31 @@ public SQLCompleter(Set completions){ try { keywords += "," + beeLine.getDatabaseConnection().getDatabaseMetaData().getSQLKeywords(); } catch (Throwable t) { + LOG.debug("fail to get SQL key words from database metadata due to the exception: ", t); } try { keywords += "," + beeLine.getDatabaseConnection().getDatabaseMetaData().getStringFunctions(); } catch (Throwable t) { + LOG.debug("fail to get string function names from database metadata due to the exception: ", + t); } try { keywords += "," + beeLine.getDatabaseConnection().getDatabaseMetaData().getNumericFunctions(); } catch (Throwable t) { + LOG.debug("fail to get numeric function names from database metadata due to the exception: ", + t); } try { keywords += "," + beeLine.getDatabaseConnection().getDatabaseMetaData().getSystemFunctions(); } catch (Throwable t) { + LOG.debug("fail to get system function names from database metadata due to the exception: ", + t); } try { keywords += "," + beeLine.getDatabaseConnection().getDatabaseMetaData().getTimeDateFunctions(); } catch (Throwable t) { + LOG.debug( + "fail to get time date function names from database metadata due to the exception: ", t); } // also allow lower-case versions of all the keywords