diff --git a/beeline/src/java/org/apache/hive/beeline/BeeLine.java b/beeline/src/java/org/apache/hive/beeline/BeeLine.java index 402fadddde..3849222f3a 100644 --- a/beeline/src/java/org/apache/hive/beeline/BeeLine.java +++ b/beeline/src/java/org/apache/hive/beeline/BeeLine.java @@ -35,7 +35,6 @@ import java.io.SequenceInputStream; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; -import java.lang.reflect.Modifier; import java.net.JarURLConnection; import java.net.URL; import java.net.URLConnection; @@ -75,9 +74,6 @@ import java.util.TreeSet; import java.util.jar.Attributes; import java.util.jar.Manifest; -import java.util.zip.ZipEntry; -import java.util.zip.ZipFile; - import jline.console.completer.Completer; import jline.console.completer.StringsCompleter; import jline.console.completer.FileNameCompleter; @@ -95,7 +91,9 @@ import org.apache.hadoop.io.IOUtils; import org.apache.hive.beeline.cli.CliOptionsProcessor; import org.apache.hive.common.util.ShutdownHookManager; -import org.apache.hive.beeline.hs2connection.BeelineHS2ConnectionFileParseException; +import org.apache.hive.beeline.hs2connection.BeelineConfFileParseException; +import org.apache.hive.beeline.hs2connection.BeelineSiteParseException; +import org.apache.hive.beeline.hs2connection.BeelineSiteParser; import org.apache.hive.beeline.hs2connection.HS2ConnectionFileUtils; import org.apache.hive.beeline.hs2connection.UserHS2ConnectionFileParser; import org.apache.hive.beeline.hs2connection.HS2ConnectionFileParser; @@ -104,6 +102,7 @@ import com.google.common.annotations.VisibleForTesting; +import org.apache.hive.jdbc.JdbcUriParseException; import org.apache.hive.jdbc.Utils; import org.apache.hive.jdbc.Utils.JdbcConnectionParams; @@ -309,16 +308,24 @@ options.addOption(OptionBuilder .hasArg() .withArgName("driver class") - .withDescription("the driver class to use") + .withDescription("The driver class to use") .create('d')); // -u options.addOption(OptionBuilder .hasArg() .withArgName("database url") - .withDescription("the JDBC URL to connect to") + .withDescription("The JDBC URL to connect to") .create('u')); + // -c + options.addOption(OptionBuilder + .hasArg() + .withArgName("named JDBC URL in beeline-site.xml") + .withDescription("The named JDBC URL to connect to, which should be present in " + + "beeline-site.xml as the value of beeline.hs2.jdbc.url.") + .create('c')); + // -r options.addOption(OptionBuilder .withLongOpt("reconnect") @@ -329,14 +336,14 @@ options.addOption(OptionBuilder .hasArg() .withArgName("username") - .withDescription("the username to connect as") + .withDescription("The username to connect as") .create('n')); // -p options.addOption(OptionBuilder .hasArg() .withArgName("password") - .withDescription("the password to connect as") + .withDescription("The password to connect as") .hasOptionalArg() .create('p')); @@ -344,7 +351,7 @@ options.addOption(OptionBuilder .hasArg() .withArgName("password-file") - .withDescription("the password file to read password from") + .withDescription("The password file to read password from") .withLongOpt("password-file") .create('w')); @@ -352,34 +359,34 @@ options.addOption(OptionBuilder .hasArg() .withArgName("authType") - .withDescription("the authentication type") + .withDescription("The authentication type") .create('a')); // -i options.addOption(OptionBuilder .hasArg() .withArgName("init") - .withDescription("script file for initialization") + .withDescription("The script file for initialization") .create('i')); // -e options.addOption(OptionBuilder .hasArgs() .withArgName("query") - .withDescription("query that should be executed") + .withDescription("The query that should be executed") .create('e')); // -f