(improvement)(chat) SemanticParseInfo removes elements whose model is empty (#459)

* (improvement)(chat) Update spi in test profile

* (improvement)(chat) SemanticParseInfo removes elements whose model is empty

* (improvement)(chat) MetricCheckProcessor compatible time dimension chName

---------

Co-authored-by: jolunoluo
This commit is contained in:
LXW
2023-12-01 11:27:07 +08:00
committed by GitHub
parent c6d59701db
commit a862a83272
4 changed files with 9 additions and 8 deletions

View File

@@ -88,10 +88,11 @@ public class SemanticParseInfo {
private Map<Long, Integer> getModelElementCountMap() { private Map<Long, Integer> getModelElementCountMap() {
Map<Long, Integer> elementCountMap = new HashMap<>(); Map<Long, Integer> elementCountMap = new HashMap<>();
elementMatches.forEach(element -> { elementMatches.stream().filter(element -> element.getElement().getModel() != null)
int count = elementCountMap.getOrDefault(element.getElement().getModel(), 0); .forEach(element -> {
elementCountMap.put(element.getElement().getModel(), count + 1); int count = elementCountMap.getOrDefault(element.getElement().getModel(), 0);
}); elementCountMap.put(element.getElement().getModel(), count + 1);
});
return elementCountMap; return elementCountMap;
} }

View File

@@ -79,7 +79,8 @@ public class MetricCheckProcessor implements ParseResultProcessor {
} }
} }
for (String dimensionName : whereFields) { for (String dimensionName : whereFields) {
if (TimeDimensionEnum.getNameList().contains(dimensionName)) { if (TimeDimensionEnum.getNameList().contains(dimensionName)
|| TimeDimensionEnum.getChNameList().contains(dimensionName)) {
continue; continue;
} }
if (!checkInModelSchema(dimensionName, SchemaElementType.DIMENSION, semanticSchema)) { if (!checkInModelSchema(dimensionName, SchemaElementType.DIMENSION, semanticSchema)) {
@@ -90,7 +91,8 @@ public class MetricCheckProcessor implements ParseResultProcessor {
} }
} }
for (String dimensionName : groupByFields) { for (String dimensionName : groupByFields) {
if (TimeDimensionEnum.getNameList().contains(dimensionName)) { if (TimeDimensionEnum.getNameList().contains(dimensionName)
|| TimeDimensionEnum.getChNameList().contains(dimensionName)) {
continue; continue;
} }
if (!checkInModelSchema(dimensionName, SchemaElementType.DIMENSION, semanticSchema)) { if (!checkInModelSchema(dimensionName, SchemaElementType.DIMENSION, semanticSchema)) {

View File

@@ -44,5 +44,4 @@ com.tencent.supersonic.chat.postprocessor.PostProcessor=\
com.tencent.supersonic.chat.postprocessor.RespBuildPostProcessor com.tencent.supersonic.chat.postprocessor.RespBuildPostProcessor
com.tencent.supersonic.chat.query.QueryResponder=\ com.tencent.supersonic.chat.query.QueryResponder=\
com.tencent.supersonic.chat.query.EntityInfoQueryResponder, \
com.tencent.supersonic.chat.query.SimilarMetricQueryResponder com.tencent.supersonic.chat.query.SimilarMetricQueryResponder

View File

@@ -43,5 +43,4 @@ com.tencent.supersonic.chat.postprocessor.PostProcessor=\
com.tencent.supersonic.chat.query.QueryResponder=\ com.tencent.supersonic.chat.query.QueryResponder=\
com.tencent.supersonic.chat.query.EntityInfoQueryResponder, \
com.tencent.supersonic.chat.query.SimilarMetricQueryResponder com.tencent.supersonic.chat.query.SimilarMetricQueryResponder