You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2022/09/13 11:05:17 UTC

[GitHub] [dolphinscheduler] hyjunhyj commented on a diff in pull request #11260: [Fix-11237][api&datasource-plugin]fix Presto data source bug

hyjunhyj commented on code in PR #11260:
URL: https://github.com/apache/dolphinscheduler/pull/11260#discussion_r969480214


##########
dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-presto/src/main/java/org/apache/dolphinscheduler/plugin/datasource/presto/param/PrestoDataSourceProcessor.java:
##########
@@ -70,15 +73,16 @@ public BaseDataSourceParamDTO createDatasourceParamDTO(String connectionJson) {
     public BaseConnectionParam createConnectionParams(BaseDataSourceParamDTO datasourceParam) {
         PrestoDataSourceParamDTO prestoParam = (PrestoDataSourceParamDTO) datasourceParam;
         String address = String.format("%s%s:%s", Constants.JDBC_PRESTO, prestoParam.getHost(), prestoParam.getPort());
-        String jdbcUrl = address + "/" + prestoParam.getDatabase();
+        String jdbcUrl = address + Constants.SLASH + prestoParam.getDatabase();
 
         PrestoConnectionParam prestoConnectionParam = new PrestoConnectionParam();
         prestoConnectionParam.setUser(prestoParam.getUserName());
         prestoConnectionParam.setPassword(PasswordUtils.encodePassword(prestoParam.getPassword()));
         prestoConnectionParam.setOther(transformOther(prestoParam.getOther()));
         prestoConnectionParam.setAddress(address);
         prestoConnectionParam.setJdbcUrl(jdbcUrl);
-        prestoConnectionParam.setDatabase(prestoParam.getDatabase());
+        prestoConnectionParam.setDatabase(prestoParam.getDatabase().split(Constants.SLASH)[0]);
+        prestoConnectionParam.setSchema(prestoParam.getDatabase().split(Constants.SLASH)[1]);

Review Comment:
   I also thought about modifying the UI before, because I couldn't find a front-end developer in the company to modify it temporarily, but I needed to use the feature at that time, so I changed it in this way.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org