Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: I edited "Connection URLs" section of JDBC part. I added "initFile" option in JDBC URL, now JDBC driver can support an init script.

...

jdbc:hive2://<host1>:<port1>,<host2>:<port2>/dbName;initFile=<file>;sess_var_list?hive_conf_list#hive_var_list

...

  • <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. 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 session
  • hive_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:///;initFile=<file> (no host or port).

Connection URL When HiveServer2 Is Running in HTTP Mode

...