When using hive jdbc, you need to have some hive session configuration,
For example:
Which queue is the current job using
The map size of the current job, the reduce size, the number of maps, and the number of reducers.
etc
The solution is: on the jdbc url, initialize the configuration.
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.