forked from github/dataease
Merge pull request #5626 from dataease/pr@dev@fixdatasource
fix: impala 过滤时间出错
This commit is contained in:
commit
de1c1edff6
@ -781,7 +781,7 @@ public class JdbcProvider extends DefaultJdbcProvider {
|
||||
case StarRocks:
|
||||
MysqlConfiguration mysqlConfiguration = new Gson().fromJson(datasource.getConfiguration(), MysqlConfiguration.class);
|
||||
mysqlConfiguration.getJdbc();
|
||||
if(!mysqlConfiguration.getDataBase().matches("^[0-9a-zA-Z_-]{1,}$")){
|
||||
if(!mysqlConfiguration.getDataBase().matches("^[0-9a-zA-Z_.-]{1,}$")){
|
||||
throw new Exception("Invalid database name");
|
||||
}
|
||||
break;
|
||||
@ -796,7 +796,7 @@ public class JdbcProvider extends DefaultJdbcProvider {
|
||||
break;
|
||||
case sqlServer:
|
||||
SqlServerConfiguration sqlServerConfiguration = new Gson().fromJson(datasource.getConfiguration(), SqlServerConfiguration.class);
|
||||
if(!sqlServerConfiguration.getDataBase().matches("^[0-9a-zA-Z_]{1,}$")){
|
||||
if(!sqlServerConfiguration.getDataBase().matches("^[0-9a-zA-Z_-]{1,}$")){
|
||||
throw new Exception("Invalid database name");
|
||||
}
|
||||
break;
|
||||
|
@ -1095,7 +1095,10 @@ public class ImpalaQueryProvider extends QueryProvider {
|
||||
whereName = "upper(" + whereName + ")";
|
||||
} else if (StringUtils.containsIgnoreCase(request.getOperator(), "between")) {
|
||||
if (request.getDatasetTableField().getDeType() == DeTypeConstants.DE_TIME) {
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
if(request.getDatasetTableField().getDeExtractType() == DeTypeConstants.DE_TIME){
|
||||
simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
|
||||
}
|
||||
String startTime = simpleDateFormat.format(new Date(Long.parseLong(value.get(0))));
|
||||
String endTime = simpleDateFormat.format(new Date(Long.parseLong(value.get(1))));
|
||||
whereValue = String.format(ImpalaConstants.WHERE_BETWEEN, startTime, endTime);
|
||||
|
Loading…
Reference in New Issue
Block a user