forked from github/dataease
fix: DB2数据集,没有根据数据源侧配置的schema 进行正确的读取
This commit is contained in:
parent
085b9141a3
commit
3f09367414
@ -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())
|
||||
|
@ -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" +
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user