mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-12 12:37:55 +00:00
[improvement](project) Adding tag abstraction to the dictionary and optimizing related code. (#785)
This commit is contained in:
@@ -20,9 +20,12 @@ public class DataSetModelConfig {
|
||||
|
||||
private List<Long> dimensions = Lists.newArrayList();
|
||||
|
||||
public DataSetModelConfig(Long id, List<Long> dimensions, List<Long> metrics) {
|
||||
private List<Long> tagIds = Lists.newArrayList();
|
||||
|
||||
public DataSetModelConfig(Long id, List<Long> dimensions, List<Long> metrics, List<Long> tagIds) {
|
||||
this.id = id;
|
||||
this.metrics = metrics;
|
||||
this.dimensions = dimensions;
|
||||
this.tagIds = tagIds;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,6 +45,11 @@ public class DataSetResp extends SchemaItem {
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public List<Long> getAllTags() {
|
||||
return getDataSetModelConfigs().stream().map(DataSetModelConfig::getTagIds)
|
||||
.flatMap(Collection::stream).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public List<Long> getAllIncludeAllModels() {
|
||||
return getDataSetModelConfigs().stream().filter(DataSetModelConfig::isIncludesAll)
|
||||
.map(DataSetModelConfig::getId)
|
||||
|
||||
@@ -15,6 +15,8 @@ public class DataSetSchemaResp extends DataSetResp {
|
||||
|
||||
private List<MetricSchemaResp> metrics = Lists.newArrayList();
|
||||
private List<DimSchemaResp> dimensions = Lists.newArrayList();
|
||||
|
||||
private List<TagResp> tags = Lists.newArrayList();
|
||||
private List<ModelResp> modelResps = Lists.newArrayList();
|
||||
|
||||
public DimSchemaResp getPrimaryKey() {
|
||||
|
||||
Reference in New Issue
Block a user