Merge pull request #3567 from dataease/pr@dev@dataset

Merge branch 'dev' into pr@dev@dataset
This commit is contained in:
xuwei-fit2cloud 2022-11-01 09:28:23 +08:00 committed by GitHub
commit 42949a30c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 10 deletions

View File

@ -125,7 +125,8 @@ public class DorisQueryProvider extends QueryProvider {
} else if (f.getDeType() == 3) {
fieldName = String.format(DorisConstants.CAST, originField, DorisConstants.DEFAULT_FLOAT_FORMAT);
} else if (f.getDeType() == 1) {
fieldName = String.format(DorisConstants.STR_TO_DATE, originField, StringUtils.isNotEmpty(f.getDateFormat()) ? f.getDateFormat() : DorisConstants.DEFAULT_DATE_FORMAT);
fieldName = StringUtils.isEmpty(f.getDateFormat()) ? String.format(DorisConstants.STR_TO_DATE, originField, DorisConstants.DEFAULT_DATE_FORMAT) :
String.format(DorisConstants.DATE_FORMAT, String.format(DorisConstants.STR_TO_DATE, originField, f.getDateFormat()), DorisConstants.DEFAULT_DATE_FORMAT);
} else {
fieldName = originField;
}
@ -201,7 +202,8 @@ public class DorisQueryProvider extends QueryProvider {
} else if (f.getDeType() == 3) {
fieldName = String.format(DorisConstants.CAST, originField, DorisConstants.DEFAULT_FLOAT_FORMAT);
} else if (f.getDeType() == 1) {
fieldName = String.format(DorisConstants.STR_TO_DATE, originField, StringUtils.isNotEmpty(f.getDateFormat()) ? f.getDateFormat() : DorisConstants.DEFAULT_DATE_FORMAT);
fieldName = StringUtils.isEmpty(f.getDateFormat()) ? String.format(DorisConstants.STR_TO_DATE, originField, DorisConstants.DEFAULT_DATE_FORMAT) :
String.format(DorisConstants.DATE_FORMAT, String.format(DorisConstants.STR_TO_DATE, originField, f.getDateFormat()), DorisConstants.DEFAULT_DATE_FORMAT);
} else {
fieldName = originField;
}

View File

@ -126,7 +126,8 @@ public class MysqlQueryProvider extends QueryProvider {
} else if (f.getDeType() == 3) {
fieldName = String.format(MysqlConstants.CAST, originField, MysqlConstants.DEFAULT_FLOAT_FORMAT);
} else if (f.getDeType() == 1) {
fieldName = String.format(MysqlConstants.STR_TO_DATE, originField, StringUtils.isNotEmpty(f.getDateFormat()) ? f.getDateFormat() : MysqlConstants.DEFAULT_DATE_FORMAT);
fieldName = StringUtils.isEmpty(f.getDateFormat()) ? String.format(MysqlConstants.STR_TO_DATE, originField, MysqlConstants.DEFAULT_DATE_FORMAT) :
String.format(MysqlConstants.DATE_FORMAT, String.format(MysqlConstants.STR_TO_DATE, originField, f.getDateFormat()), MysqlConstants.DEFAULT_DATE_FORMAT);
} else {
fieldName = originField;
}
@ -201,7 +202,8 @@ public class MysqlQueryProvider extends QueryProvider {
} else if (f.getDeType() == 3) {
fieldName = String.format(MysqlConstants.CAST, originField, MysqlConstants.DEFAULT_FLOAT_FORMAT);
} else if (f.getDeType() == 1) {
fieldName = String.format(MysqlConstants.STR_TO_DATE, originField, StringUtils.isNotEmpty(f.getDateFormat()) ? f.getDateFormat() : MysqlConstants.DEFAULT_DATE_FORMAT);
fieldName = StringUtils.isEmpty(f.getDateFormat()) ? String.format(MysqlConstants.STR_TO_DATE, originField, MysqlConstants.DEFAULT_DATE_FORMAT) :
String.format(MysqlConstants.DATE_FORMAT, String.format(MysqlConstants.STR_TO_DATE, originField, f.getDateFormat()), MysqlConstants.DEFAULT_DATE_FORMAT);
} else {
fieldName = originField;
}
@ -979,9 +981,9 @@ public class MysqlQueryProvider extends QueryProvider {
} else {
// Doris field type test
/*if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3 || field.getDeExtractType() == 4) {
whereValue = String.format(DorisConstants.WHERE_NUMBER_VALUE, value);
whereValue = String.format(MysqlConstants.WHERE_NUMBER_VALUE, value);
} else {
whereValue = String.format(DorisConstants.WHERE_VALUE_VALUE, value);
whereValue = String.format(MysqlConstants.WHERE_VALUE_VALUE, value);
}*/
whereValue = String.format(MysqlConstants.WHERE_VALUE_VALUE, value);
}
@ -1089,9 +1091,9 @@ public class MysqlQueryProvider extends QueryProvider {
} else {
// doris field type test
/*if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3 || field.getDeExtractType() == 4) {
whereValue = String.format(DorisConstants.WHERE_NUMBER_VALUE, value.get(0));
whereValue = String.format(MysqlConstants.WHERE_NUMBER_VALUE, value.get(0));
} else {
whereValue = String.format(DorisConstants.WHERE_VALUE_VALUE, value.get(0));
whereValue = String.format(MysqlConstants.WHERE_VALUE_VALUE, value.get(0));
}*/
whereValue = String.format(MysqlConstants.WHERE_VALUE_VALUE, value.get(0));
}

View File

@ -129,7 +129,8 @@ public class MysqlQueryProvider extends QueryProvider {
} else if (f.getDeType() == 3) {
fieldName = String.format(MySQLConstants.CAST, originField, MySQLConstants.DEFAULT_FLOAT_FORMAT);
} else if (f.getDeType() == 1) {
fieldName = String.format(MySQLConstants.STR_TO_DATE, originField, StringUtils.isNotEmpty(f.getDateFormat()) ? f.getDateFormat() : MysqlConstants.DEFAULT_DATE_FORMAT);
fieldName = StringUtils.isEmpty(f.getDateFormat()) ? String.format(MySQLConstants.STR_TO_DATE, originField, MysqlConstants.DEFAULT_DATE_FORMAT) :
String.format(MySQLConstants.DATE_FORMAT, String.format(MySQLConstants.STR_TO_DATE, originField, f.getDateFormat()), MySQLConstants.DEFAULT_DATE_FORMAT);
} else {
fieldName = originField;
}
@ -188,7 +189,8 @@ public class MysqlQueryProvider extends QueryProvider {
} else if (f.getDeType() == 3) {
fieldName = String.format(MySQLConstants.CAST, originField, MySQLConstants.DEFAULT_FLOAT_FORMAT);
} else if (f.getDeType() == 1) {
fieldName = String.format(MySQLConstants.STR_TO_DATE, originField, StringUtils.isNotEmpty(f.getDateFormat()) ? f.getDateFormat() : MysqlConstants.DEFAULT_DATE_FORMAT);
fieldName = StringUtils.isEmpty(f.getDateFormat()) ? String.format(MySQLConstants.STR_TO_DATE, originField, MysqlConstants.DEFAULT_DATE_FORMAT) :
String.format(MySQLConstants.DATE_FORMAT, String.format(MySQLConstants.STR_TO_DATE, originField, f.getDateFormat()), MySQLConstants.DEFAULT_DATE_FORMAT);
} else {
fieldName = originField;
}