mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-11 03:58:14 +00:00
[improvement][headless]Move discovery of query models from SemanticNode to QueryParser.
This commit is contained in:
@@ -45,14 +45,6 @@ public class SemanticSchemaResp {
|
||||
.orElse(null);
|
||||
}
|
||||
|
||||
public List<MetricSchemaResp> getMetrics(List<String> bizNames) {
|
||||
Map<String, MetricSchemaResp> metricLowerToNameMap = metrics.stream().collect(
|
||||
Collectors.toMap(entry -> entry.getBizName().toLowerCase(), entry -> entry));
|
||||
return bizNames.stream().map(String::toLowerCase)
|
||||
.filter(entry -> metricLowerToNameMap.containsKey(entry))
|
||||
.map(entry -> metricLowerToNameMap.get(entry)).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public DimSchemaResp getDimension(String bizName) {
|
||||
return dimensions.stream()
|
||||
.filter(dimension -> bizName.equalsIgnoreCase(dimension.getBizName())).findFirst()
|
||||
@@ -64,14 +56,6 @@ public class SemanticSchemaResp {
|
||||
.orElse(null);
|
||||
}
|
||||
|
||||
public List<DimSchemaResp> getDimensions(List<String> bizNames) {
|
||||
Map<String, DimSchemaResp> dimLowerToNameMap = dimensions.stream().collect(
|
||||
Collectors.toMap(entry -> entry.getBizName().toLowerCase(), entry -> entry));
|
||||
return bizNames.stream().map(String::toLowerCase)
|
||||
.filter(entry -> dimLowerToNameMap.containsKey(entry))
|
||||
.map(entry -> dimLowerToNameMap.get(entry)).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public Set<String> getNameFromBizNames(Set<String> bizNames) {
|
||||
Set<String> names = new HashSet<>();
|
||||
for (String bizName : bizNames) {
|
||||
|
||||
Reference in New Issue
Block a user