Hive JDBC 配置session properties
程序员文章站
2022-04-25 14:30:25
...
在使用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://<host1>:<port1>,<host2>:<port2>/dbName;initFile=<file>;sess_var_list?hive_conf_list#hive_var_list
where
- <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 session
- hive_var_list is a semicolon separated list of key=value pairs of Hive variables for this session.
推荐阅读
-
使用SSM框架开发applicationContext.xml和jdbc.properties配置文件的使用
-
JDBC工具类抽取方法(使用properties配置文件)
-
在applicationContext.xml中设置读取jdbc.properties文件&配置jdbcTemplate对象
-
【SSM框架集成】jdbc.properties数据库log4j.properties日志文件 applicationContext.xml配置applicationContext-mvc.xml
-
Hive JDBC 配置session properties
-
在applicationContext.xml中设置读取jdbc.properties文件&配置jdbcTemplate对象