Skip to content

Commit

Permalink
[Fix][Connector] Fix presto/trino execute job error (#324)
Browse files Browse the repository at this point in the history
  • Loading branch information
zixi0825 authored Dec 22, 2023
1 parent ae704f2 commit 4c54a28
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
import io.datavines.common.datasource.jdbc.JdbcConnectionInfo;
import io.datavines.common.param.ConnectorResponse;
import io.datavines.common.param.TestConnectionRequestParam;
import io.datavines.common.param.form.Validate;
import io.datavines.common.param.form.type.InputParam;
import io.datavines.common.utils.JSONUtils;
import io.datavines.common.utils.StringUtils;
import io.datavines.connector.api.DataSourceClient;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ protected String getUrl(Map<String, Object> parameter) {
parameter.get(PORT),
parameter.get(CATALOG));
}

String properties = (String)parameter.get(PROPERTIES);
if (StringUtils.isNotEmpty(properties)) {
url += "?" + properties;
}
return url;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public Connection getConnection(Properties properties) throws SQLException {

@Override
public JdbcTemplate getJdbcTemplate(BaseJdbcDataSourceInfo baseJdbcDataSourceInfo) throws SQLException {
JdbcTemplate jdbcTemplate = new JdbcTemplate(JdbcDataSourceManager.getInstance().getDataSource(baseJdbcDataSourceInfo));
JdbcTemplate jdbcTemplate = new JdbcTemplate(getDataSource(baseJdbcDataSourceInfo));
jdbcTemplate.setFetchSize(500);
return jdbcTemplate;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
import io.datavines.common.datasource.jdbc.JdbcConnectionInfo;
import io.datavines.common.param.ConnectorResponse;
import io.datavines.common.param.TestConnectionRequestParam;
import io.datavines.common.param.form.Validate;
import io.datavines.common.param.form.type.InputParam;
import io.datavines.common.utils.JSONUtils;
import io.datavines.common.utils.StringUtils;
import io.datavines.connector.api.DataSourceClient;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ protected String getUrl(Map<String, Object> parameter) {
parameter.get(PORT),
parameter.get(CATALOG));
}

String properties = (String)parameter.get(PROPERTIES);
if (StringUtils.isNotEmpty(properties)) {
url += "?" + properties;
}
return url;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public Connection getConnection(Properties properties) throws SQLException {

@Override
public JdbcTemplate getJdbcTemplate(BaseJdbcDataSourceInfo baseJdbcDataSourceInfo) throws SQLException {
JdbcTemplate jdbcTemplate = new JdbcTemplate(JdbcDataSourceManager.getInstance().getDataSource(baseJdbcDataSourceInfo));
JdbcTemplate jdbcTemplate = new JdbcTemplate(getDataSource(baseJdbcDataSourceInfo));
jdbcTemplate.setFetchSize(500);
return jdbcTemplate;
}
Expand Down

0 comments on commit 4c54a28

Please sign in to comment.