Merge pull request #794 from dataease/pr@v1.2@fix_doris_date

fix: doris日期过滤
This commit is contained in:
XiaJunjie2020 2021-09-08 17:55:52 +08:00 committed by GitHub
commit d4f8991085
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -772,7 +772,13 @@ public class DorisQueryProvider extends QueryProvider {
whereValue = String.format(DorisConstants.WHERE_BETWEEN, value.get(0), value.get(1));
}
} else {
whereValue = String.format(DorisConstants.WHERE_VALUE_VALUE, value.get(0));
if (request.getDatasetTableField().getDeType() == 1) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String time = simpleDateFormat.format(new Date(Long.parseLong(value.get(0))));
whereValue = String.format(DorisConstants.WHERE_VALUE_VALUE, time);
} else {
whereValue = String.format(DorisConstants.WHERE_VALUE_VALUE, value.get(0));
}
}
list.add(SQLObj.builder()
.whereField(whereName)