(improvement)(chat) remove tableCorrector and add replaceFieldNameByValue test (#162)

This commit is contained in:
lexluo09
2023-09-27 21:03:40 +08:00
committed by GitHub
parent e688422ec3
commit 155cf22841
2 changed files with 18 additions and 20 deletions

View File

@@ -1,20 +0,0 @@
package com.tencent.supersonic.chat.corrector;
import com.tencent.supersonic.chat.api.pojo.SemanticCorrectInfo;
import com.tencent.supersonic.common.util.jsqlparser.SqlParserUpdateHelper;
import lombok.extern.slf4j.Slf4j;
@Slf4j
public class TableCorrector extends BaseSemanticCorrector {
public static final String TABLE_PREFIX = "t_";
@Override
public void correct(SemanticCorrectInfo semanticCorrectInfo) {
super.correct(semanticCorrectInfo);
Long modelId = semanticCorrectInfo.getParseInfo().getModelId();
String sql = SqlParserUpdateHelper.replaceTable(semanticCorrectInfo.getSql(), TABLE_PREFIX + modelId);
semanticCorrectInfo.setSql(sql);
}
}