(improvement)(chat) fix dding default date according to the query type (#746)

This commit is contained in:
lexluo09
2024-02-23 17:36:25 +08:00
committed by GitHub
parent bfd0e040da
commit c224b81160

View File

@@ -72,7 +72,7 @@ public class WhereCorrector extends BaseSemanticCorrector {
&& StringUtils.isNotBlank(startEndDate.getRight())) {
correctS2SQL = SqlAddHelper.addParenthesisToWhere(correctS2SQL);
String dateChName = TimeDimensionEnum.DAY.getChName();
String condExpr = String.format(" ( %s >= %s and %s <= %s )", dateChName,
String condExpr = String.format(" ( %s >= '%s' and %s <= '%s' )", dateChName,
startEndDate.getLeft(), dateChName, startEndDate.getRight());
try {
Expression expression = CCJSqlParserUtil.parseCondExpression(condExpr);