mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-11 03:58:14 +00:00
(improvement)(chat) support add parenthesis and add arenthesis in sys_imp_date (#184)
This commit is contained in:
@@ -72,6 +72,7 @@ public class WhereCorrector extends BaseSemanticCorrector {
|
||||
List<String> whereFields = SqlParserSelectHelper.getWhereFields(sql);
|
||||
if (CollectionUtils.isEmpty(whereFields) || !whereFields.contains(DateUtils.DATE_FIELD)) {
|
||||
String currentDate = DSLDateHelper.getReferenceDate(semanticCorrectInfo.getParseInfo().getModelId());
|
||||
sql = SqlParserUpdateHelper.addParenthesisToWhere(sql);
|
||||
sql = SqlParserUpdateHelper.addWhere(sql, DateUtils.DATE_FIELD, currentDate);
|
||||
}
|
||||
semanticCorrectInfo.setSql(sql);
|
||||
|
||||
Reference in New Issue
Block a user