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了

 

posted @ 2022-02-08 16:03  Tim&Blog  阅读(276)  评论(0编辑  收藏  举报