Merge pull request #6058 from dataease/pr@dev@pgsql

Pr@dev@pgsql
This commit is contained in:
taojinlong 2023-09-07 12:35:03 +08:00 committed by GitHub
commit 23b58400c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 19 additions and 8 deletions

View File

@ -14,11 +14,19 @@ public class Db2Configuration extends JdbcConfiguration {
public String getJdbc() {
if(StringUtils.isEmpty(extraParams.trim())){
return "jdbc:db2://HOSTNAME:PORT/DATABASE:currentSchema=SCHEMA;"
.replace("HOSTNAME", getHost().trim())
.replace("PORT", getPort().toString().trim())
.replace("DATABASE", getDataBase().trim()
.replace("SCHEMA",getSchema().trim()));
if (StringUtils.isEmpty(getSchema())) {
return "jdbc:db2://HOSTNAME:PORT/DATABASE:currentSchema=SCHEMA;"
.replace("HOSTNAME", getHost().trim())
.replace("PORT", getPort().toString().trim())
.replace("DATABASE", getDataBase().trim());
} else {
return "jdbc:db2://HOSTNAME:PORT/DATABASE:currentSchema=SCHEMA;"
.replace("HOSTNAME", getHost().trim())
.replace("PORT", getPort().toString().trim())
.replace("DATABASE", getDataBase().trim())
.replace("SCHEMA", getSchema().trim());
}
}else {
return "jdbc:hive2://HOSTNAME:PORT/DATABASE?EXTRA_PARAMS"
.replace("HOSTNAME", getHost().trim())

View File

@ -31,11 +31,9 @@ import org.stringtemplate.v4.STGroup;
import org.stringtemplate.v4.STGroupFile;
import javax.annotation.Resource;
import java.text.Format;
import java.text.MessageFormat;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.atomic.AtomicReference;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
@ -1415,6 +1413,11 @@ public class CKQueryProvider extends QueryProvider {
}
}
@Override
public String sqlForPreview(String table, Datasource ds) {
return "SELECT * FROM " + String.format(CKConstants.KEYWORD_TABLE, table);
}
public List<Dateformat> dateformat() {
return JSONArray.parseArray("[\n" +
"{\"dateformat\": \"%Y%m%d\"},\n" +

View File

@ -211,7 +211,7 @@ public class ExtractDataService {
for (DatasetTableField oldField : oldFields) {
boolean delete = true;
for (DatasetTableField datasetTableField : datasetTableFields) {
if (oldField.getDataeaseName().equalsIgnoreCase(datasetTableField.getDataeaseName())) {
if (oldField.getDataeaseName().equalsIgnoreCase(datasetTableField.getDataeaseName()) && oldField.getType().equalsIgnoreCase(datasetTableField.getType())) {
delete = false;
}
}