(improvement)(semantic) Querying dimension values supports models without time dimensions (#528)

Co-authored-by: jolunoluo
This commit is contained in:
LXW
2023-12-18 13:18:18 +08:00
committed by GitHub
parent dfb3b59984
commit 64615cbef9
9 changed files with 66 additions and 62 deletions

View File

@@ -93,7 +93,7 @@ public class DimensionServiceImpl implements DimensionService {
return;
}
Long modelId = dimensionReqs.get(0).getModelId();
List<DimensionResp> dimensionResps = getDimensions(modelId);
List<DimensionResp> dimensionResps = getDimensionInSameDomain(modelId);
Map<String, DimensionResp> bizNameMap = dimensionResps.stream()
.collect(Collectors.toMap(DimensionResp::getBizName, a -> a, (k1, k2) -> k1));
Map<String, DimensionResp> nameMap = dimensionResps.stream()

View File

@@ -63,6 +63,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
@@ -303,7 +304,8 @@ public class ModelServiceImpl implements ModelService {
modelRespSet = modelRespSet.stream().filter(modelResp ->
modelResp.getDomainId().equals(domainId)).collect(Collectors.toSet());
}
return new ArrayList<>(modelRespSet);
return modelRespSet.stream().sorted(Comparator.comparingLong(ModelResp::getId))
.collect(Collectors.toList());
}
public List<ModelResp> getModelRespAuthInheritDomain(User user, AuthType authType) {

View File

@@ -105,7 +105,6 @@ public class ModelConverter {
}
public static MetricReq convert(Measure measure, ModelDO modelDO) {
measure.setDatasourceId(modelDO.getId());
MetricReq metricReq = new MetricReq();
metricReq.setName(measure.getName());
metricReq.setBizName(measure.getBizName().replaceFirst(modelDO.getBizName() + "_", ""));