CDH 6.3.2
I use
<dependency>
<groupId>org.apache.hive</groupId>
<artifactId>hive-jdbc</artifactId>
<version>2.1.1-cdh6.3.2</version>
</dependency>
I want proxy to user read_hi
final String URL = "jdbc:hive2://tidb4ser:21051/;principal=impala/tidb4ser1@JOIN.COM;impala.doas.user=read_hi";
System.setProperty("java.security.krb5.conf",krb5Path);
Configuration conf = new Configuration();
conf.set("hadoop.security.authentication", "Kerberos");
UserGroupInformation.setConfiguration(conf);
UserGroupInformation.loginUserFromKeytab(principal,keytabPath);
Class.forName("org.apache.hive.jdbc.HiveDriver");
Connection connection = DriverManager.getConnection(URL);
Statement st = connection.createStatement();
st.execute("use hivetest");
ResultSet rs = st.executeQuery("SELECT id,name,year FROM hivetest.chinese_par t where t.city='重庆'");
but it dosen't work.
I can use
final String HIVE_URL = "jdbc:hive2://tidb4ser:11000/;principal=hive/tidb4ser1@JOIN.COM;hive.server2.proxy.user=read_hi";
to connect Hive
so, How can I proxy user with impala
Do I need use
<dependency>
<groupId>com.cloudera.impala.jdbc</groupId>
<artifactId>ImpalaJDBC41</artifactId>
<version>2.6.20</version>
</dependency>