[fix-#11726] fix error when set connection proerty both in the URL and an argument (#15093)

Co-authored-by: zhangying14 <zhangying14@zuoyebang.com>
Co-authored-by: xiangzihao <460888207@qq.com>
This commit is contained in:
izualzhy 2023-11-03 14:44:27 +08:00 committed by GitHub
parent dc503b0e00
commit 8665951981
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 4 deletions

View File

@ -102,10 +102,11 @@ public class PrestoDataSourceProcessor extends AbstractDataSourceProcessor {
@Override
public String getJdbcUrl(ConnectionParam connectionParam) {
PrestoConnectionParam prestoConnectionParam = (PrestoConnectionParam) connectionParam;
if (MapUtils.isNotEmpty(prestoConnectionParam.getOther())) {
return String.format("%s?%s", prestoConnectionParam.getJdbcUrl(),
transformOther(prestoConnectionParam.getOther()));
}
/**
* return jdbc url without other parameters, avoid to assign same parameters both in URL and properties.
* or else got error msg: Connection property '...' is both in the URL and an argument
* ref to <a href="https://prestodb.io/docs/current/installation/jdbc.html">Presto JDBC Driver</>
*/
return prestoConnectionParam.getJdbcUrl();
}