fix: 直连presto数据源使用时间过滤组件报错 #6359

This commit is contained in:
taojinlong 2023-11-22 17:43:06 +08:00
parent fd0fe7dff4
commit 4175d58e8f

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));
}