dolphinscheduler本地部署調試及對接星環TDH-inceptor組件用于sql查詢(三)
接著上次調試的過程部署時候,發現dolphinscheduler連接tdh時候validationQuery還是select 1
這里懷疑可能是由于dolphinscheduler存在硬編碼問題,修改了代碼也不生效
我們這樣改代碼:
dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-api/src/main/java/org/apache/dolphinscheduler/plugin/datasource/api/datasource/hive/HiveDatasourceProcessor.java
hiveConnectionParam.setUser(hiveParam.getUserName());
hiveConnectionParam.setPassword(PasswordUtils.encodePassword(hiveParam.getPassword()));
hiveConnectionParam.setDriverClassName(getDatasourceDriver());
hiveConnectionParam.setValidationQuery(getValidationQuery());
// hiveConnectionParam.setValidationQuery(getValidationQuery());
if (CommonUtils.getKerberosStartupState()) {
hiveConnectionParam.setPrincipal(hiveParam.getPrincipal());
hiveConnectionParam.setLoginUserKeytabPath(hiveParam.getLoginUserKeytabPath());
hiveConnectionParam.setLoginUserKeytabUsername(hiveParam.getLoginUserKeytabUsername());
}
hiveConnectionParam.setValidationQuery("show databases;");
hiveConnectionParam.setOther(transformOther(hiveParam.getOther()));
hiveConnectionParam.setProps(hiveParam.getOther());
return hiveConnectionParam;
hiveConnectionParam.setValidationQuery("show databases;");
修改為這個代碼,不要用getValidationQuery()函數,修改了函數里面的常量不生效,然后打包重新部署即可,經過測試可以連接上tdh的inceptor了

支付寶
微信
浙公網安備 33010602011771號