mirror of
https://gitee.com/dolphinscheduler/DolphinScheduler.git
synced 2024-11-30 03:08:01 +08:00
* [Fix-7375][datasource] remove excess hive jdbc principal (#7375) * fix ut
This commit is contained in:
parent
b3fe217e08
commit
8c3fa47903
@ -328,9 +328,8 @@ public class DataSourceServiceTest {
|
||||
hiveDataSourceParamDTO.setLoginUserKeytabPath("/opt/hdfs.headless.keytab");
|
||||
hiveDataSourceParamDTO.setLoginUserKeytabUsername("test2/hdfs-mycluster@ESZ.COM");
|
||||
connectionParam = DataSourceUtils.buildConnectionParams(hiveDataSourceParamDTO);
|
||||
expected = "{\"user\":\"test\",\"password\":\"test\",\"address\":\"jdbc:hive2://192.168.9.1:10000\",\"database\":\"im\",\"jdbcUrl\":\"jdbc:hive2://192.168.9.1:10000/im;"
|
||||
+ "principal=hive/hdfs-mycluster@ESZ.COM\",\"driverClassName\":\"org.apache.hive.jdbc.HiveDriver\",\"validationQuery\":\"select 1\",\"principal\":\"hive/hdfs-mycluster@ESZ.COM\","
|
||||
+ "\"javaSecurityKrb5Conf\":\"/opt/krb5.conf\",\"loginUserKeytabUsername\":\"test2/hdfs-mycluster@ESZ.COM\",\"loginUserKeytabPath\":\"/opt/hdfs.headless.keytab\"}";
|
||||
|
||||
expected = "{\"user\":\"test\",\"password\":\"test\",\"address\":\"jdbc:hive2://192.168.9.1:10000\",\"database\":\"im\",\"jdbcUrl\":\"jdbc:hive2://192.168.9.1:10000/im\",\"driverClassName\":\"org.apache.hive.jdbc.HiveDriver\",\"validationQuery\":\"select 1\",\"principal\":\"hive/hdfs-mycluster@ESZ.COM\",\"javaSecurityKrb5Conf\":\"/opt/krb5.conf\",\"loginUserKeytabUsername\":\"test2/hdfs-mycluster@ESZ.COM\",\"loginUserKeytabPath\":\"/opt/hdfs.headless.keytab\"}";
|
||||
Assert.assertEquals(expected, JSONUtils.toJsonString(connectionParam));
|
||||
|
||||
}
|
||||
|
@ -74,9 +74,6 @@ public class HiveDatasourceProcessor extends AbstractDatasourceProcessor {
|
||||
}
|
||||
address.deleteCharAt(address.length() - 1);
|
||||
String jdbcUrl = address.toString() + "/" + hiveParam.getDatabase();
|
||||
if (CommonUtils.getKerberosStartupState()) {
|
||||
jdbcUrl += ";principal=" + hiveParam.getPrincipal();
|
||||
}
|
||||
|
||||
HiveConnectionParam hiveConnectionParam = new HiveConnectionParam();
|
||||
hiveConnectionParam.setDatabase(hiveParam.getDatabase());
|
||||
|
@ -77,9 +77,6 @@ public class SparkDatasourceProcessor extends AbstractDatasourceProcessor {
|
||||
address.deleteCharAt(address.length() - 1);
|
||||
|
||||
String jdbcUrl = address + "/" + sparkDatasourceParam.getDatabase();
|
||||
if (CommonUtils.getKerberosStartupState()) {
|
||||
jdbcUrl += ";principal=" + sparkDatasourceParam.getPrincipal();
|
||||
}
|
||||
|
||||
SparkConnectionParam sparkConnectionParam = new SparkConnectionParam();
|
||||
sparkConnectionParam.setPassword(PasswordUtils.encodePassword(sparkDatasourceParam.getPassword()));
|
||||
|
Loading…
Reference in New Issue
Block a user