Merge pull request #6799 from dataease/pr@dev@fixSql

fix: 直连presto数据源使用时间过滤组件报错 #6359
This commit is contained in:
taojinlong 2023-11-22 03:53:07 -06:00 committed by GitHub
commit a6c23c4074
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1097,7 +1097,9 @@ public class PrestoQueryProvider extends QueryProvider {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
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(PrestoConstants.WHERE_BETWEEN, startTime, endTime);
startTime = String.format("CAST('%s' AS %s)", startTime, "timestamp");
endTime = String.format("CAST('%s' AS %s)", endTime, "timestamp");
whereValue = String.format("%s AND %s",startTime, endTime);
} else {
whereValue = String.format(PrestoConstants.WHERE_BETWEEN, value.get(0), value.get(1));
}