Qiheng He created HIVE-28652:
--------------------------------

             Summary: Add the `org.apache.hadoop.mapred.JobConf` class to the 
HiveServer2 JDBC Driver Uber JAR
                 Key: HIVE-28652
                 URL: https://issues.apache.org/jira/browse/HIVE-28652
             Project: Hive
          Issue Type: Improvement
      Security Level: Public (Viewable by anyone)
            Reporter: Qiheng He


* I personally wish the *HiveServer2 JDBC Driver Uber JAR* would include the 
*org.apache.hadoop:hadoop-mapreduce-client-core:3.3.6* Maven module's 
*org.apache.hadoop.mapred.JobConf* class.
 *  Although the HiveServer2 JDBC Driver Uber JAR 
*org.apache.hive:hive-jdbc:4.0.1:standalone* can now connect to HiveServer2, 
downstream projects like *apache/shardingsphere* sometimes connect directly to 
the {*}Hive Metastore Server{*}.

{code:java}
import org.apache.hadoop.hive.conf.HiveConf;
import org.apache.hadoop.hive.metastore.HiveMetaStoreClient;
import org.apache.hadoop.hive.metastore.api.MetaException;
public class ExampleTest {

    void test() throws MetaException {
        HiveConf hiveConf = new HiveConf();
        hiveConf.set("hive.metastore.uris", "thrift://metastore:9083");
        HiveMetaStoreClient storeClient = new HiveMetaStoreClient(hiveConf);
        storeClient.close();
    }
}
{code}
 - Although the Uber JAR *org.apache.hive:hive-jdbc:4.0.1:standalone* of 
HiveServer2 JDBC Driver contains {*}org.apache.hadoop.hive.conf.HiveConf{*}, 
*org.apache.hadoop.hive.conf.HiveConf* itself uses 
*org.apache.hadoop.mapred.JobConf* which does not exist in the Uber JAR. This 
causes downstream projects to specifically introduce additional dependencies.

{code:xml}
<dependency>
    <groupId>org.apache.hadoop</groupId>
    <artifactId>hadoop-mapreduce-client-core</artifactId>
    <version>3.3.6</version>
    <exclusions>
        <exclusion>
            <groupId>*</groupId>
            <artifactId>*</artifactId>
        </exclusion>
    </exclusions>
</dependency>
{code}
 - I believe there is room for improvement. Early investigations come from 
[https://github.com/apache/shardingsphere/pull/33837] and 
[https://github.com/linghengqian/hive-server2-jdbc-driver/pull/15] .



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to