mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-12 04:27:39 +00:00
[improvement][Chat] Add TimeCorrector and rename the associated SqlParserHelper. (#707)
This commit is contained in:
@@ -11,7 +11,7 @@ import com.tencent.supersonic.common.pojo.enums.QueryType;
|
||||
import com.tencent.supersonic.common.util.ContextUtils;
|
||||
import com.tencent.supersonic.common.util.DateModeUtils;
|
||||
import com.tencent.supersonic.common.util.SqlFilterUtils;
|
||||
import com.tencent.supersonic.common.util.jsqlparser.SqlParserAddHelper;
|
||||
import com.tencent.supersonic.common.util.jsqlparser.SqlAddHelper;
|
||||
import lombok.Data;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.sf.jsqlparser.JSQLParserException;
|
||||
@@ -156,7 +156,7 @@ public class QueryStructReq extends SemanticQueryReq {
|
||||
}
|
||||
|
||||
/**
|
||||
* convert queryStructReq to QueryS2QLReq
|
||||
* convert queryStructReq to QueryS2SQLReq
|
||||
*
|
||||
* @param queryStructReq
|
||||
* @return
|
||||
@@ -261,7 +261,7 @@ public class QueryStructReq extends SemanticQueryReq {
|
||||
String sql = select.toString();
|
||||
if (StringUtils.isNotBlank(whereClause)) {
|
||||
Expression expression = CCJSqlParserUtil.parseCondExpression(whereClause);
|
||||
sql = SqlParserAddHelper.addWhere(sql, expression);
|
||||
sql = SqlAddHelper.addWhere(sql, expression);
|
||||
}
|
||||
|
||||
//7.Set DateInfo
|
||||
@@ -269,7 +269,7 @@ public class QueryStructReq extends SemanticQueryReq {
|
||||
String dateWhereStr = dateModeUtils.getDateWhereStr(queryStructReq.getDateInfo());
|
||||
if (StringUtils.isNotBlank(dateWhereStr)) {
|
||||
Expression expression = CCJSqlParserUtil.parseCondExpression(dateWhereStr);
|
||||
sql = SqlParserAddHelper.addWhere(sql, expression);
|
||||
sql = SqlAddHelper.addWhere(sql, expression);
|
||||
}
|
||||
return sql;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user