mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-11 20:25:12 +00:00
(improvement)(Headless) fix add information about whether dimensions are tags in fetchDataSetSchema (#860)
This commit is contained in:
@@ -244,15 +244,15 @@ public class DimensionServiceImpl implements DimensionService {
|
|||||||
|
|
||||||
List<Long> dimensionIds = dimensionResps.stream().map(dimensionResp -> dimensionResp.getId())
|
List<Long> dimensionIds = dimensionResps.stream().map(dimensionResp -> dimensionResp.getId())
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
List<TagItem> tagItems = tagMetaService.getTagItems(User.getFakeUser(), dimensionIds, TagDefineType.METRIC);
|
List<TagItem> tagItems = tagMetaService.getTagItems(User.getFakeUser(), dimensionIds, TagDefineType.DIMENSION);
|
||||||
Map<Long, TagItem> itemIdToTagItem = tagItems.stream()
|
Map<Long, TagItem> itemIdToTagItem = tagItems.stream()
|
||||||
.collect(Collectors.toMap(tag -> tag.getItemId(), tag -> tag, (newTag, oldTag) -> newTag));
|
.collect(Collectors.toMap(tag -> tag.getItemId(), tag -> tag, (newTag, oldTag) -> newTag));
|
||||||
|
|
||||||
if (Objects.nonNull(itemIdToTagItem)) {
|
if (Objects.nonNull(itemIdToTagItem)) {
|
||||||
dimensionResps.stream().forEach(metricResp -> {
|
dimensionResps.stream().forEach(dimensionResp -> {
|
||||||
Long metricRespId = metricResp.getId();
|
Long metricRespId = dimensionResp.getId();
|
||||||
if (itemIdToTagItem.containsKey(metricRespId)) {
|
if (itemIdToTagItem.containsKey(metricRespId)) {
|
||||||
metricResp.setIsTag(itemIdToTagItem.get(metricRespId).getIsTag());
|
dimensionResp.setIsTag(itemIdToTagItem.get(metricRespId).getIsTag());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -288,4 +288,4 @@ CREATE TABLE IF NOT EXISTS `s2_query_rule` (
|
|||||||
COMMENT ON TABLE s2_query_rule IS 'tag query rule table';
|
COMMENT ON TABLE s2_query_rule IS 'tag query rule table';
|
||||||
|
|
||||||
--20240325
|
--20240325
|
||||||
ALTER TABLE s2_metric RENAME COLUMN tags TO classifications;
|
alter table s2_metric change tags classifications varchar(500) null;
|
||||||
Reference in New Issue
Block a user