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

Merge pull request #436 from dataease/pr@dev@fix_doris类型转换

fix: doris类型转换
......@@ -41,4 +41,6 @@ public class DorisConstants extends SQLConstants {
public static final String BRACKETS = "(%s)";
public static final String ROUND = "ROUND(%s,%s)";
public static final String VARCHAR = "VARCHAR";
}
......@@ -519,6 +519,8 @@ public class DorisQueryProvider extends QueryProvider {
if (field.getDeType() == 1 && field.getDeExtractType() != 1) {
String cast = String.format(DorisConstants.CAST, originName, DorisConstants.DEFAULT_INT_FORMAT) + "/1000";
whereName = String.format(DorisConstants.FROM_UNIXTIME, cast, DorisConstants.DEFAULT_DATE_FORMAT);
} else if (field.getDeType() == 0) {
whereName = String.format(DorisConstants.CAST, originName, DorisConstants.VARCHAR);
} else {
whereName = originName;
}
......@@ -560,6 +562,8 @@ public class DorisQueryProvider extends QueryProvider {
if (field.getDeType() == 1 && field.getDeExtractType() != 1) {
String cast = String.format(DorisConstants.CAST, originName, DorisConstants.DEFAULT_INT_FORMAT) + "/1000";
whereName = String.format(DorisConstants.FROM_UNIXTIME, cast, DorisConstants.DEFAULT_DATE_FORMAT);
} else if (field.getDeType() == 0) {
whereName = String.format(DorisConstants.CAST, originName, DorisConstants.VARCHAR);
} else {
whereName = originName;
}
......@@ -636,6 +640,8 @@ public class DorisQueryProvider extends QueryProvider {
String from_unixtime = String.format(DorisConstants.FROM_UNIXTIME, cast, DorisConstants.DEFAULT_DATE_FORMAT);
fieldName = String.format(DorisConstants.DATE_FORMAT, from_unixtime, format);
}
} else if (x.getDeType() == 0) {
fieldName = String.format(DorisConstants.CAST, originField, DorisConstants.VARCHAR);
} else {
fieldName = originField;
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论