mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-11 12:07:42 +00:00
fix:java.lang.NullPointerException: Cannot invoke "com.tencent.supersonic.common.pojo.DateConf.getDateField()" because "dateConf" is null (#2142)
This commit is contained in:
@@ -425,8 +425,12 @@ public class DictUtils {
|
|||||||
.format(DateTimeFormatter.ofPattern(format));
|
.format(DateTimeFormatter.ofPattern(format));
|
||||||
String end = LocalDate.now().minusDays(itemValueDateEnd)
|
String end = LocalDate.now().minusDays(itemValueDateEnd)
|
||||||
.format(DateTimeFormatter.ofPattern(format));
|
.format(DateTimeFormatter.ofPattern(format));
|
||||||
|
if (Objects.nonNull(dateConf)) {
|
||||||
return String.format("( %s >= '%s' and %s <= '%s' )", dateConf.getDateField(), start,
|
return String.format("( %s >= '%s' and %s <= '%s' )", dateConf.getDateField(), start,
|
||||||
dateConf.getDateField(), end);
|
dateConf.getDateField(), end);
|
||||||
|
} else {
|
||||||
|
return String.format("( %s >= '%s' and %s <= '%s' )", "dt", start, "dt", end);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private String generateDictDateFilter(DictItemResp dictItemResp) {
|
private String generateDictDateFilter(DictItemResp dictItemResp) {
|
||||||
@@ -440,7 +444,7 @@ public class DictUtils {
|
|||||||
}
|
}
|
||||||
// 未进行设置
|
// 未进行设置
|
||||||
if (Objects.isNull(config) || Objects.isNull(config.getDateConf())) {
|
if (Objects.isNull(config) || Objects.isNull(config.getDateConf())) {
|
||||||
return defaultDateFilter(config.getDateConf());
|
return defaultDateFilter(null);
|
||||||
}
|
}
|
||||||
// 全表扫描
|
// 全表扫描
|
||||||
if (DateConf.DateMode.ALL.equals(config.getDateConf().getDateMode())) {
|
if (DateConf.DateMode.ALL.equals(config.getDateConf().getDateMode())) {
|
||||||
|
|||||||
Reference in New Issue
Block a user