Hive JDBC 配置session properties

阅读更多
在使用hive jdbc的时候,需要有一些hive session的配置,
比如说:
当前作业使用的是哪条队列
当前作业的map大小,reduce大小,map个数,reduce的个数。
等等
 
解决方案是:在jdbc url上面,进行初始化的配置。
Connection URL Format
The HiveServer2 URL is a string with the following syntax:
jdbc:hive2:// :,:/dbName;initFile=;sess_var_list?hive_conf_list#hive_var_list
where
  • :,: 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.
  •  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 session
  • hive_var_list is a semicolon separated list of key=value pairs of Hive variables for this session.
 
 
ref: https://cwiki.apache.org/confluence/display/Hive/HiveServer2+Clients

你可能感兴趣的:(hive,jdbc,properties,配置)