mirror of
https://github.com/tencentmusic/supersonic.git
synced 2026-04-25 17:24:27 +08:00
(improvement)(semantic) Querying dimension values supports models without time dimensions (#528)
Co-authored-by: jolunoluo
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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() + "_", ""));
|
||||
|
||||
Reference in New Issue
Block a user