mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-12 20:51:48 +00:00
(improvement)(chat) fix dding default date according to the query type (#746)
This commit is contained in:
@@ -72,7 +72,7 @@ public class WhereCorrector extends BaseSemanticCorrector {
|
|||||||
&& StringUtils.isNotBlank(startEndDate.getRight())) {
|
&& StringUtils.isNotBlank(startEndDate.getRight())) {
|
||||||
correctS2SQL = SqlAddHelper.addParenthesisToWhere(correctS2SQL);
|
correctS2SQL = SqlAddHelper.addParenthesisToWhere(correctS2SQL);
|
||||||
String dateChName = TimeDimensionEnum.DAY.getChName();
|
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());
|
startEndDate.getLeft(), dateChName, startEndDate.getRight());
|
||||||
try {
|
try {
|
||||||
Expression expression = CCJSqlParserUtil.parseCondExpression(condExpr);
|
Expression expression = CCJSqlParserUtil.parseCondExpression(condExpr);
|
||||||
|
|||||||
Reference in New Issue
Block a user