Unverified 提交 aeb35b01 authored 作者: XiaJunjie2020's avatar XiaJunjie2020 提交者: GitHub

Merge pull request #848 from dataease/pr@v1.2@fix_doris_type

fix: Doris类型
...@@ -33,6 +33,8 @@ public class DorisConstants extends SQLConstants { ...@@ -33,6 +33,8 @@ public class DorisConstants extends SQLConstants {
public static final String WHERE_VALUE_VALUE = "'%s'"; public static final String WHERE_VALUE_VALUE = "'%s'";
public static final String WHERE_NUMBER_VALUE = "%s";
public static final String AGG_COUNT = "COUNT(*)"; public static final String AGG_COUNT = "COUNT(*)";
public static final String AGG_FIELD = "%s(%s)"; public static final String AGG_FIELD = "%s(%s)";
......
...@@ -708,7 +708,11 @@ public class DorisQueryProvider extends QueryProvider { ...@@ -708,7 +708,11 @@ public class DorisQueryProvider extends QueryProvider {
} else if (StringUtils.containsIgnoreCase(request.getTerm(), "like")) { } else if (StringUtils.containsIgnoreCase(request.getTerm(), "like")) {
whereValue = "'%" + value + "%'"; whereValue = "'%" + value + "%'";
} else { } else {
whereValue = String.format(DorisConstants.WHERE_VALUE_VALUE, value); if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3 || field.getDeExtractType() == 4) {
whereValue = String.format(DorisConstants.WHERE_NUMBER_VALUE, value);
} else {
whereValue = String.format(DorisConstants.WHERE_VALUE_VALUE, value);
}
} }
list.add(SQLObj.builder() list.add(SQLObj.builder()
.whereField(whereName) .whereField(whereName)
...@@ -772,7 +776,11 @@ public class DorisQueryProvider extends QueryProvider { ...@@ -772,7 +776,11 @@ public class DorisQueryProvider extends QueryProvider {
whereValue = String.format(DorisConstants.WHERE_BETWEEN, value.get(0), value.get(1)); whereValue = String.format(DorisConstants.WHERE_BETWEEN, value.get(0), value.get(1));
} }
} else { } else {
whereValue = String.format(DorisConstants.WHERE_VALUE_VALUE, value.get(0)); if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3 || field.getDeExtractType() == 4) {
whereValue = String.format(DorisConstants.WHERE_NUMBER_VALUE, value.get(0));
} else {
whereValue = String.format(DorisConstants.WHERE_VALUE_VALUE, value.get(0));
}
} }
list.add(SQLObj.builder() list.add(SQLObj.builder()
.whereField(whereName) .whereField(whereName)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论