feat(视图): 增加小数精度

This commit is contained in:
junjun 2022-07-19 17:03:41 +08:00
parent dfa4522bcf
commit 0fd5be758e
3 changed files with 3 additions and 3 deletions

View File

@ -1206,7 +1206,7 @@ public class DorisQueryProvider extends QueryProvider {
String cast = String.format(DorisConstants.CAST, originField, y.getDeType() == 2 ? DorisConstants.DEFAULT_INT_FORMAT : DorisConstants.DEFAULT_FLOAT_FORMAT);
String agg = String.format(DorisConstants.AGG_FIELD, y.getSummary(), cast);
String cast1 = String.format(DorisConstants.CAST, agg, DorisConstants.DEFAULT_FLOAT_FORMAT);
fieldName = String.format(DorisConstants.ROUND, cast1, "2");
fieldName = String.format(DorisConstants.ROUND, cast1, "8");
} else {
String cast = String.format(DorisConstants.CAST, originField, y.getDeType() == 2 ? DorisConstants.DEFAULT_INT_FORMAT : DorisConstants.DEFAULT_FLOAT_FORMAT);
if (StringUtils.equalsIgnoreCase(y.getSummary(), "count_distinct")) {

View File

@ -1212,7 +1212,7 @@ public class MysqlQueryProvider extends QueryProvider {
String cast = String.format(MysqlConstants.CAST, originField, y.getDeType() == 2 ? MysqlConstants.DEFAULT_INT_FORMAT : MysqlConstants.DEFAULT_FLOAT_FORMAT);
String agg = String.format(MysqlConstants.AGG_FIELD, y.getSummary(), cast);
String cast1 = String.format(MysqlConstants.CAST, agg, MysqlConstants.DEFAULT_FLOAT_FORMAT);
fieldName = String.format(MysqlConstants.ROUND, cast1, "2");
fieldName = String.format(MysqlConstants.ROUND, cast1, "8");
} else {
String cast = String.format(MysqlConstants.CAST, originField, y.getDeType() == 2 ? MysqlConstants.DEFAULT_INT_FORMAT : MysqlConstants.DEFAULT_FLOAT_FORMAT);
if (StringUtils.equalsIgnoreCase(y.getSummary(), "count_distinct")) {

View File

@ -1213,7 +1213,7 @@ public class EsQueryProvider extends QueryProvider {
if (StringUtils.equalsIgnoreCase(y.getSummary(), "avg") || StringUtils.containsIgnoreCase(y.getSummary(), "pop")) {
String cast = String.format(EsSqlLConstants.CAST, originField, y.getDeType() == DeTypeConstants.DE_INT ? "bigint" : "double");
String agg = String.format(EsSqlLConstants.AGG_FIELD, y.getSummary(), cast);
fieldName = String.format(EsSqlLConstants.ROUND, agg, "2");
fieldName = String.format(EsSqlLConstants.ROUND, agg, "8");
} else {
String cast = String.format(EsSqlLConstants.CAST, originField, y.getDeType() == DeTypeConstants.DE_INT ? "bigint" : "double");
if (StringUtils.equalsIgnoreCase(y.getSummary(), "count_distinct")) {