(improvement)(chat) if there is no group by in dsl,set MetricTable's aggOption to NATIVE (#195)

This commit is contained in:
lexluo09
2023-10-11 23:51:09 +08:00
committed by GitHub
parent a191bbbf6e
commit e6f2ce2598
2 changed files with 14 additions and 11 deletions

View File

@@ -22,9 +22,9 @@ public class EntityInfoExecuteResponder implements ExecuteResponder {
}
SemanticService semanticService = ContextUtils.getBean(SemanticService.class);
User user = queryReq.getUser();
queryResult.setEntityInfo(semanticService.getEntityInfo(semanticParseInfo, user));
EntityInfo entityInfo = semanticService.getEntityInfo(semanticParseInfo, user);
queryResult.setEntityInfo(entityInfo);
EntityInfo entityInfo = semanticService.getEntityInfo(semanticParseInfo.getModelId());
if (Objects.isNull(entityInfo) || Objects.isNull(entityInfo.getModelInfo())
|| Objects.isNull(entityInfo.getModelInfo().getPrimaryEntityName())) {
return;
@@ -36,6 +36,8 @@ public class EntityInfoExecuteResponder implements ExecuteResponder {
boolean existPrimaryEntityName = queryResult.getQueryColumns().stream()
.anyMatch(queryColumn -> primaryEntityBizName.equals(queryColumn.getNameEn()));
semanticParseInfo.setNativeQuery(existPrimaryEntityName);
if (!existPrimaryEntityName) {
return;
}