...
<host1>:<port1>,<host2>:<port2>
is a server instance or a comma separated list of server instances to connect to (if dynamic service discovery is enabled). If empty, the embedded server will be used.dbName
is the name of the initial database.- <file> is the path of init script file (Hive 2.2.0 and later). This script file is written with SQL statements which will be executed automatically after connection. This option can be empty.
sess_var_list
is a semicolon separated list of key=value pairs of session variables (e.g.,user=foo;password=bar
).hive_conf_list
is a semicolon separated list of key=value pairs of Hive configuration variables for this sessionhive_var_list
is a semicolon separated list of key=value pairs of Hive variables for this session.
...
- For a remote server, the URL format is
jdbc:hive2://<host>:<port>/<db>;initFile=<file>
(default port for HiveServer2 is 10000). - For an embedded server, the URL format is
jdbc:hive2:///;
(no host or port).initFile=<file>
The initFile
option is available in Hive 2.2.0 and later releases.
Connection URL When HiveServer2 Is Running in HTTP Mode
...