[Fix-7392][dolphinscheduler-datasource] Add hive datasource failed (#7393)

* fix bug_7392

* fix bug_7392

* fix bug_7392

Co-authored-by: SbloodyS <sbloodys@qq.com>
dailidong-patch-1
SbloodyS 2021-12-15 17:36:05 +08:00 committed by GitHub
parent 801e6dd6bb
commit a17a8d777a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -19,6 +19,7 @@ package org.apache.dolphinscheduler.plugin.datasource.hive;
import static org.apache.dolphinscheduler.spi.task.TaskConstants.JAVA_SECURITY_KRB5_CONF;
import static org.apache.dolphinscheduler.spi.task.TaskConstants.JAVA_SECURITY_KRB5_CONF_PATH;
import static org.apache.dolphinscheduler.spi.task.TaskConstants.HADOOP_SECURITY_AUTHENTICATION_STARTUP_STATE;
import org.apache.dolphinscheduler.plugin.datasource.api.client.CommonDataSourceClient;
import org.apache.dolphinscheduler.plugin.datasource.api.provider.JDBCDataSourceProvider;
@ -90,7 +91,8 @@ public class HiveDataSourceClient extends CommonDataSourceClient {
private void checkKerberosEnv() {
String krb5File = PropertyUtils.getString(JAVA_SECURITY_KRB5_CONF_PATH);
if (StringUtils.isNotBlank(krb5File)) {
Boolean kerberosStartupState = PropertyUtils.getBoolean(HADOOP_SECURITY_AUTHENTICATION_STARTUP_STATE, false);
if (kerberosStartupState && StringUtils.isNotBlank(krb5File)) {
System.setProperty(JAVA_SECURITY_KRB5_CONF, krb5File);
try {
Config.refresh();