(improvement) optimize schema data change monitoring (#333)

Co-authored-by: jolunoluo
This commit is contained in:
LXW
2023-11-06 22:11:56 +08:00
committed by GitHub
parent 6e3f871015
commit aa6c658a9a
14 changed files with 101 additions and 10 deletions

View File

@@ -47,7 +47,9 @@ public class EmbeddingMapper extends BaseMapper {
long modelId = Long.parseLong(modelIdStr);
schemaElement = getSchemaElement(modelId, schemaElement.getType(), elementId);
if (schemaElement == null) {
continue;
}
SchemaElementMatch schemaElementMatch = SchemaElementMatch.builder()
.element(schemaElement)
.frequency(BaseWordBuilder.DEFAULT_FREQUENCY)

View File

@@ -109,6 +109,7 @@ public abstract class RuleSemanticQuery implements SemanticQuery, Serializable {
for (SchemaElementMatch schemaMatch : parseInfo.getElementMatches()) {
SchemaElement element = schemaMatch.getElement();
element.setOrder(1 - schemaMatch.getSimilarity());
switch (element.getType()) {
case ID:
SchemaElement entityElement = modelSchema.getElement(SchemaElementType.ENTITY, element.getId());

View File

@@ -230,6 +230,9 @@ public class ConfigServiceImpl implements ConfigService {
BeanUtils.copyProperties(chatConfigResp, chatConfigRich);
ModelSchema modelSchema = semanticService.getModelSchema(modelId);
if (modelSchema == null) {
return chatConfigRich;
}
chatConfigRich.setBizName(modelSchema.getModel().getBizName());
chatConfigRich.setModelName(modelSchema.getModel().getName());

View File

@@ -51,6 +51,9 @@ public class RecommendServiceImpl implements RecommendService {
return new RecommendResp();
}
ModelSchema modelSchema = semanticService.getModelSchema(modelId);
if (Objects.isNull(modelSchema)) {
return new RecommendResp();
}
List<Long> drillDownDimensions = Lists.newArrayList();
Set<SchemaElement> metricElements = modelSchema.getMetrics();
if (recommendReq.getMetricId() != null && !CollectionUtils.isEmpty(metricElements)) {