mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-13 21:17:08 +00:00
(improvement)(semantic) support metric relate dimension setting (#229)
Co-authored-by: jolunoluo
This commit is contained in:
@@ -13,6 +13,7 @@ import com.tencent.supersonic.common.pojo.enums.AuthType;
|
||||
import com.tencent.supersonic.common.pojo.enums.DictWordType;
|
||||
import com.tencent.supersonic.common.pojo.exception.InvalidArgumentException;
|
||||
import com.tencent.supersonic.common.util.ChatGptHelper;
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.DrillDownDimension;
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.Measure;
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.MetricTypeParams;
|
||||
import com.tencent.supersonic.semantic.api.model.request.MetricReq;
|
||||
@@ -29,6 +30,8 @@ import com.tencent.supersonic.semantic.model.domain.repository.MetricRepository;
|
||||
import com.tencent.supersonic.semantic.model.domain.utils.MetricConverter;
|
||||
import com.tencent.supersonic.semantic.model.domain.MetricService;
|
||||
import com.tencent.supersonic.semantic.model.domain.pojo.Metric;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -186,6 +189,14 @@ public class MetricServiceImpl implements MetricService {
|
||||
return metricResp;
|
||||
}
|
||||
|
||||
private MetricResp getMetric(Long id) {
|
||||
MetricDO metricDO = metricRepository.getMetricById(id);
|
||||
if (metricDO == null) {
|
||||
return null;
|
||||
}
|
||||
return MetricConverter.convert2MetricResp(metricDO, new HashMap<>());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateExprMetric(MetricReq metricReq, User user) {
|
||||
preCheckMetric(metricReq);
|
||||
@@ -286,6 +297,19 @@ public class MetricServiceImpl implements MetricService {
|
||||
metricResp.getTags().stream()).collect(Collectors.toSet());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DrillDownDimension> getDrillDownDimension(Long metricId) {
|
||||
MetricResp metricResp = getMetric(metricId);
|
||||
if (metricResp == null) {
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
if (metricResp.getRelateDimension() != null
|
||||
&& !CollectionUtils.isEmpty(metricResp.getRelateDimension().getDrillDownDimensions())) {
|
||||
return metricResp.getRelateDimension().getDrillDownDimensions();
|
||||
}
|
||||
ModelResp modelResp = modelService.getModel(metricResp.getModelId());
|
||||
return modelResp.getDrillDownDimensions();
|
||||
}
|
||||
|
||||
private void saveMetricBatch(List<Metric> metrics, User user) {
|
||||
if (CollectionUtils.isEmpty(metrics)) {
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.tencent.supersonic.auth.api.authentication.service.UserService;
|
||||
import com.tencent.supersonic.common.pojo.enums.AuthType;
|
||||
import com.tencent.supersonic.common.util.BeanMapper;
|
||||
import com.tencent.supersonic.common.util.JsonUtil;
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.RelateDimension;
|
||||
import com.tencent.supersonic.semantic.api.model.request.ModelReq;
|
||||
import com.tencent.supersonic.semantic.api.model.request.ModelSchemaFilterReq;
|
||||
import com.tencent.supersonic.semantic.api.model.response.DatabaseResp;
|
||||
@@ -75,7 +76,7 @@ public class ModelServiceImpl implements ModelService {
|
||||
|
||||
@Override
|
||||
public void createModel(ModelReq modelReq, User user) {
|
||||
log.info("[create model] cmd : {}", JSONObject.toJSONString(modelReq));
|
||||
log.info("[create model] req : {}", JSONObject.toJSONString(modelReq));
|
||||
Model model = ModelConvert.convert(modelReq);
|
||||
log.info("[create model] object:{}", JSONObject.toJSONString(modelReq));
|
||||
saveModel(model, user);
|
||||
@@ -261,7 +262,7 @@ public class ModelServiceImpl implements ModelService {
|
||||
ModelSchemaResp modelSchemaResp = new ModelSchemaResp();
|
||||
BeanUtils.copyProperties(modelResp, modelSchemaResp);
|
||||
modelSchemaResp.setDimensions(generateDimSchema(modelId));
|
||||
modelSchemaResp.setMetrics(generateMetricSchema(modelId));
|
||||
modelSchemaResp.setMetrics(generateMetricSchema(modelId, modelResp));
|
||||
return modelSchemaResp;
|
||||
}
|
||||
|
||||
@@ -292,7 +293,7 @@ public class ModelServiceImpl implements ModelService {
|
||||
List<MeasureResp> measureResps = measureRespsMap.getOrDefault(modelId, Lists.newArrayList());
|
||||
List<MetricResp> metricResps = metricRespMap.getOrDefault(modelId, Lists.newArrayList());
|
||||
List<MetricSchemaResp> metricSchemaResps = metricResps.stream().map(metricResp ->
|
||||
convert(metricResp, metricResps, measureResps)).collect(Collectors.toList());
|
||||
convert(metricResp, metricResps, measureResps, modelResp)).collect(Collectors.toList());
|
||||
List<DimSchemaResp> dimensionResps = dimensionRespsMap.getOrDefault(modelId, Lists.newArrayList())
|
||||
.stream().map(this::convert).collect(Collectors.toList());
|
||||
ModelSchemaResp modelSchemaResp = new ModelSchemaResp();
|
||||
@@ -314,12 +315,12 @@ public class ModelServiceImpl implements ModelService {
|
||||
return null;
|
||||
}
|
||||
|
||||
private List<MetricSchemaResp> generateMetricSchema(Long modelId) {
|
||||
private List<MetricSchemaResp> generateMetricSchema(Long modelId, ModelResp modelResp) {
|
||||
List<MetricSchemaResp> metricSchemaDescList = new ArrayList<>();
|
||||
List<MetricResp> metricResps = metricService.getMetrics(modelId);
|
||||
List<MeasureResp> measureResps = datasourceService.getMeasureListOfModel(modelId);
|
||||
metricResps.stream().forEach(metricResp ->
|
||||
metricSchemaDescList.add(convert(metricResp, metricResps, measureResps)));
|
||||
metricSchemaDescList.add(convert(metricResp, metricResps, measureResps, modelResp)));
|
||||
return metricSchemaDescList;
|
||||
}
|
||||
|
||||
@@ -336,9 +337,14 @@ public class ModelServiceImpl implements ModelService {
|
||||
}
|
||||
|
||||
private MetricSchemaResp convert(MetricResp metricResp, List<MetricResp> metricResps,
|
||||
List<MeasureResp> measureResps) {
|
||||
List<MeasureResp> measureResps, ModelResp modelResp) {
|
||||
MetricSchemaResp metricSchemaResp = new MetricSchemaResp();
|
||||
BeanUtils.copyProperties(metricResp, metricSchemaResp);
|
||||
RelateDimension relateDimension = metricResp.getRelateDimension();
|
||||
if (relateDimension == null || CollectionUtils.isEmpty(relateDimension.getDrillDownDimensions())) {
|
||||
metricSchemaResp.setRelateDimension(RelateDimension.builder()
|
||||
.drillDownDimensions(modelResp.getDrillDownDimensions()).build());
|
||||
}
|
||||
metricSchemaResp.setUseCnt(0L);
|
||||
String agg = catalog.getAgg(metricResps, measureResps, metricSchemaResp.getBizName());
|
||||
metricSchemaResp.setDefaultAgg(agg);
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.tencent.supersonic.semantic.model.domain;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.tencent.supersonic.auth.api.authentication.pojo.User;
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.DrillDownDimension;
|
||||
import com.tencent.supersonic.semantic.api.model.request.MetricReq;
|
||||
import com.tencent.supersonic.semantic.api.model.request.PageMetricReq;
|
||||
import com.tencent.supersonic.semantic.api.model.response.MetricResp;
|
||||
@@ -40,4 +41,6 @@ public interface MetricService {
|
||||
List<String> mockAlias(MetricReq metricReq, String mockType, User user);
|
||||
|
||||
Set<String> getMetricTags();
|
||||
|
||||
List<DrillDownDimension> getDrillDownDimension(Long metricId);
|
||||
}
|
||||
|
||||
@@ -83,6 +83,11 @@ public class MetricDO {
|
||||
*/
|
||||
private String tags;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String relateDimensions;
|
||||
|
||||
/**
|
||||
* 类型参数
|
||||
*/
|
||||
@@ -344,6 +349,22 @@ public class MetricDO {
|
||||
this.tags = tags == null ? null : tags.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return relate_dimensions
|
||||
*/
|
||||
public String getRelateDimensions() {
|
||||
return relateDimensions;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param relateDimensions
|
||||
*/
|
||||
public void setRelateDimensions(String relateDimensions) {
|
||||
this.relateDimensions = relateDimensions == null ? null : relateDimensions.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* 类型参数
|
||||
* @return type_params 类型参数
|
||||
|
||||
@@ -1262,6 +1262,76 @@ public class MetricDOExample {
|
||||
addCriterion("tags not between", value1, value2, "tags");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andRelateDimensionsIsNull() {
|
||||
addCriterion("relate_dimensions is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andRelateDimensionsIsNotNull() {
|
||||
addCriterion("relate_dimensions is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andRelateDimensionsEqualTo(String value) {
|
||||
addCriterion("relate_dimensions =", value, "relateDimensions");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andRelateDimensionsNotEqualTo(String value) {
|
||||
addCriterion("relate_dimensions <>", value, "relateDimensions");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andRelateDimensionsGreaterThan(String value) {
|
||||
addCriterion("relate_dimensions >", value, "relateDimensions");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andRelateDimensionsGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("relate_dimensions >=", value, "relateDimensions");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andRelateDimensionsLessThan(String value) {
|
||||
addCriterion("relate_dimensions <", value, "relateDimensions");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andRelateDimensionsLessThanOrEqualTo(String value) {
|
||||
addCriterion("relate_dimensions <=", value, "relateDimensions");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andRelateDimensionsLike(String value) {
|
||||
addCriterion("relate_dimensions like", value, "relateDimensions");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andRelateDimensionsNotLike(String value) {
|
||||
addCriterion("relate_dimensions not like", value, "relateDimensions");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andRelateDimensionsIn(List<String> values) {
|
||||
addCriterion("relate_dimensions in", values, "relateDimensions");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andRelateDimensionsNotIn(List<String> values) {
|
||||
addCriterion("relate_dimensions not in", values, "relateDimensions");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andRelateDimensionsBetween(String value1, String value2) {
|
||||
addCriterion("relate_dimensions between", value1, value2, "relateDimensions");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andRelateDimensionsNotBetween(String value1, String value2) {
|
||||
addCriterion("relate_dimensions not between", value1, value2, "relateDimensions");
|
||||
return (Criteria) this;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -73,6 +73,11 @@ public class ModelDO {
|
||||
*/
|
||||
private Date updatedAt;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String drillDownDimensions;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@@ -302,6 +307,22 @@ public class ModelDO {
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return drill_down_dimensions
|
||||
*/
|
||||
public String getDrillDownDimensions() {
|
||||
return drillDownDimensions;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param drillDownDimensions
|
||||
*/
|
||||
public void setDrillDownDimensions(String drillDownDimensions) {
|
||||
this.drillDownDimensions = drillDownDimensions == null ? null : drillDownDimensions.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return entity
|
||||
|
||||
@@ -1132,6 +1132,76 @@ public class ModelDOExample {
|
||||
addCriterion("updated_at not between", value1, value2, "updatedAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDrillDownDimensionsIsNull() {
|
||||
addCriterion("drill_down_dimensions is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDrillDownDimensionsIsNotNull() {
|
||||
addCriterion("drill_down_dimensions is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDrillDownDimensionsEqualTo(String value) {
|
||||
addCriterion("drill_down_dimensions =", value, "drillDownDimensions");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDrillDownDimensionsNotEqualTo(String value) {
|
||||
addCriterion("drill_down_dimensions <>", value, "drillDownDimensions");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDrillDownDimensionsGreaterThan(String value) {
|
||||
addCriterion("drill_down_dimensions >", value, "drillDownDimensions");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDrillDownDimensionsGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("drill_down_dimensions >=", value, "drillDownDimensions");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDrillDownDimensionsLessThan(String value) {
|
||||
addCriterion("drill_down_dimensions <", value, "drillDownDimensions");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDrillDownDimensionsLessThanOrEqualTo(String value) {
|
||||
addCriterion("drill_down_dimensions <=", value, "drillDownDimensions");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDrillDownDimensionsLike(String value) {
|
||||
addCriterion("drill_down_dimensions like", value, "drillDownDimensions");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDrillDownDimensionsNotLike(String value) {
|
||||
addCriterion("drill_down_dimensions not like", value, "drillDownDimensions");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDrillDownDimensionsIn(List<String> values) {
|
||||
addCriterion("drill_down_dimensions in", values, "drillDownDimensions");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDrillDownDimensionsNotIn(List<String> values) {
|
||||
addCriterion("drill_down_dimensions not in", values, "drillDownDimensions");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDrillDownDimensionsBetween(String value1, String value2) {
|
||||
addCriterion("drill_down_dimensions between", value1, value2, "drillDownDimensions");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDrillDownDimensionsNotBetween(String value1, String value2) {
|
||||
addCriterion("drill_down_dimensions not between", value1, value2, "drillDownDimensions");
|
||||
return (Criteria) this;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.tencent.supersonic.semantic.model.domain.pojo;
|
||||
|
||||
import com.tencent.supersonic.common.pojo.DataFormat;
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.MetricTypeParams;
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.RelateDimension;
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.SchemaItem;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@@ -27,6 +28,8 @@ public class Metric extends SchemaItem {
|
||||
|
||||
private List<String> tags;
|
||||
|
||||
private RelateDimension relateDimension;
|
||||
|
||||
public String getTag() {
|
||||
if (CollectionUtils.isEmpty(tags)) {
|
||||
return "";
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
package com.tencent.supersonic.semantic.model.domain.pojo;
|
||||
|
||||
|
||||
import com.tencent.supersonic.common.pojo.enums.StatusEnum;
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.DrillDownDimension;
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.Entity;
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.SchemaItem;
|
||||
import com.tencent.supersonic.semantic.api.model.request.ModelReq;
|
||||
import lombok.Data;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@@ -30,12 +27,6 @@ public class Model extends SchemaItem {
|
||||
|
||||
private Entity entity;
|
||||
|
||||
public static Model create(ModelReq modelReq) {
|
||||
Model model = new Model();
|
||||
BeanUtils.copyProperties(modelReq, model);
|
||||
model.setStatus(StatusEnum.ONLINE.getCode());
|
||||
return model;
|
||||
}
|
||||
|
||||
private List<DrillDownDimension> drillDownDimensions;
|
||||
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.google.common.collect.Lists;
|
||||
import com.tencent.supersonic.common.pojo.DataFormat;
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.Measure;
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.MetricTypeParams;
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.RelateDimension;
|
||||
import com.tencent.supersonic.semantic.api.model.response.ModelResp;
|
||||
import com.tencent.supersonic.semantic.api.model.yaml.MeasureYamlTpl;
|
||||
import com.tencent.supersonic.semantic.api.model.yaml.MetricTypeParamsYamlTpl;
|
||||
@@ -37,6 +38,9 @@ public class MetricConverter {
|
||||
if (metric.getDataFormat() != null) {
|
||||
metricDO.setDataFormat(JSONObject.toJSONString(metric.getDataFormat()));
|
||||
}
|
||||
if (metric.getRelateDimension() != null) {
|
||||
metricDO.setRelateDimensions(JSONObject.toJSONString(metric.getRelateDimension()));
|
||||
}
|
||||
metricDO.setTags(metric.getTag());
|
||||
return metricDO;
|
||||
}
|
||||
@@ -53,6 +57,7 @@ public class MetricConverter {
|
||||
metricDO.setTypeParams(JSONObject.toJSONString(metric.getTypeParams()));
|
||||
metricDO.setDataFormat(JSONObject.toJSONString(metric.getDataFormat()));
|
||||
metricDO.setTags(metric.getTag());
|
||||
metricDO.setRelateDimensions(JSONObject.toJSONString(metric.getRelateDimension()));
|
||||
return metricDO;
|
||||
}
|
||||
|
||||
@@ -68,6 +73,8 @@ public class MetricConverter {
|
||||
metricResp.setDomainId(modelResp.getDomainId());
|
||||
}
|
||||
metricResp.setTag(metricDO.getTags());
|
||||
metricResp.setRelateDimension(JSONObject.parseObject(metricDO.getRelateDimensions(),
|
||||
RelateDimension.class));
|
||||
return metricResp;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.google.common.collect.Lists;
|
||||
import com.tencent.supersonic.auth.api.authentication.pojo.User;
|
||||
import com.tencent.supersonic.common.pojo.enums.StatusEnum;
|
||||
import com.tencent.supersonic.common.util.JsonUtil;
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.DrillDownDimension;
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.Entity;
|
||||
import com.tencent.supersonic.semantic.api.model.request.ModelReq;
|
||||
import com.tencent.supersonic.semantic.api.model.response.DomainResp;
|
||||
@@ -38,6 +39,7 @@ public class ModelConvert {
|
||||
modelDO.setViewer(String.join(",", model.getViewers()));
|
||||
modelDO.setViewOrg(String.join(",", model.getViewOrgs()));
|
||||
modelDO.setEntity(JsonUtil.toString(model.getEntity()));
|
||||
modelDO.setDrillDownDimensions(JsonUtil.toString(model.getDrillDownDimensions()));
|
||||
return modelDO;
|
||||
}
|
||||
|
||||
@@ -53,6 +55,7 @@ public class ModelConvert {
|
||||
modelResp.setViewOrgs(StringUtils.isBlank(modelDO.getViewOrg())
|
||||
? Lists.newArrayList() : Arrays.asList(modelDO.getViewOrg().split(",")));
|
||||
modelResp.setEntity(JsonUtil.toObject(modelDO.getEntity(), Entity.class));
|
||||
modelResp.setDrillDownDimensions(JsonUtil.toList(modelDO.getDrillDownDimensions(), DrillDownDimension.class));
|
||||
return modelResp;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ package com.tencent.supersonic.semantic.model.rest;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.tencent.supersonic.auth.api.authentication.pojo.User;
|
||||
import com.tencent.supersonic.auth.api.authentication.utils.UserHolder;
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.DrillDownDimension;
|
||||
import com.tencent.supersonic.semantic.api.model.request.MetricReq;
|
||||
import com.tencent.supersonic.semantic.api.model.request.PageMetricReq;
|
||||
import com.tencent.supersonic.semantic.api.model.response.MetricResp;
|
||||
@@ -99,4 +100,9 @@ public class MetricController {
|
||||
return metricService.getMetricTags();
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/getDrillDownDimension")
|
||||
public List<DrillDownDimension> getDrillDownDimension(Long metricId) {
|
||||
return metricService.getDrillDownDimension(metricId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
<result column="data_format" jdbcType="VARCHAR" property="dataFormat" />
|
||||
<result column="alias" jdbcType="VARCHAR" property="alias" />
|
||||
<result column="tags" jdbcType="VARCHAR" property="tags" />
|
||||
<result column="relate_dimensions" jdbcType="VARCHAR" property="relateDimensions" />
|
||||
</resultMap>
|
||||
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.tencent.supersonic.semantic.model.domain.dataobject.MetricDO">
|
||||
<result column="type_params" jdbcType="LONGVARCHAR" property="typeParams" />
|
||||
@@ -53,7 +54,7 @@
|
||||
</sql>
|
||||
<sql id="Base_Column_List">
|
||||
id, model_id, name, biz_name, description, status, sensitive_level, type, created_at,
|
||||
created_by, updated_at, updated_by, data_format_type, data_format, alias, tags
|
||||
created_by, updated_at, updated_by, data_format_type, data_format, alias, tags, relate_dimensions
|
||||
</sql>
|
||||
<sql id="Blob_Column_List">
|
||||
type_params
|
||||
@@ -109,13 +110,15 @@
|
||||
sensitive_level, type, created_at,
|
||||
created_by, updated_at, updated_by,
|
||||
data_format_type, data_format, alias,
|
||||
tags, type_params)
|
||||
tags, relate_dimensions, type_params
|
||||
)
|
||||
values (#{id,jdbcType=BIGINT}, #{modelId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR},
|
||||
#{bizName,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER},
|
||||
#{sensitiveLevel,jdbcType=INTEGER}, #{type,jdbcType=VARCHAR}, #{createdAt,jdbcType=TIMESTAMP},
|
||||
#{createdBy,jdbcType=VARCHAR}, #{updatedAt,jdbcType=TIMESTAMP}, #{updatedBy,jdbcType=VARCHAR},
|
||||
#{dataFormatType,jdbcType=VARCHAR}, #{dataFormat,jdbcType=VARCHAR}, #{alias,jdbcType=VARCHAR},
|
||||
#{tags,jdbcType=VARCHAR}, #{typeParams,jdbcType=LONGVARCHAR})
|
||||
#{tags,jdbcType=VARCHAR}, #{relateDimensions,jdbcType=VARCHAR}, #{typeParams,jdbcType=LONGVARCHAR}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.MetricDO">
|
||||
insert into s2_metric
|
||||
@@ -168,6 +171,9 @@
|
||||
<if test="tags != null">
|
||||
tags,
|
||||
</if>
|
||||
<if test="relateDimensions != null">
|
||||
relate_dimensions,
|
||||
</if>
|
||||
<if test="typeParams != null">
|
||||
type_params,
|
||||
</if>
|
||||
@@ -221,6 +227,9 @@
|
||||
<if test="tags != null">
|
||||
#{tags,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="relateDimensions != null">
|
||||
#{relateDimensions,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="typeParams != null">
|
||||
#{typeParams,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
@@ -280,6 +289,9 @@
|
||||
<if test="tags != null">
|
||||
tags = #{tags,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="relateDimensions != null">
|
||||
relate_dimensions = #{relateDimensions,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="typeParams != null">
|
||||
type_params = #{typeParams,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
@@ -303,6 +315,7 @@
|
||||
data_format = #{dataFormat,jdbcType=VARCHAR},
|
||||
alias = #{alias,jdbcType=VARCHAR},
|
||||
tags = #{tags,jdbcType=VARCHAR},
|
||||
relate_dimensions = #{relateDimensions,jdbcType=VARCHAR},
|
||||
type_params = #{typeParams,jdbcType=LONGVARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
@@ -322,7 +335,8 @@
|
||||
data_format_type = #{dataFormatType,jdbcType=VARCHAR},
|
||||
data_format = #{dataFormat,jdbcType=VARCHAR},
|
||||
alias = #{alias,jdbcType=VARCHAR},
|
||||
tags = #{tags,jdbcType=VARCHAR}
|
||||
tags = #{tags,jdbcType=VARCHAR},
|
||||
relate_dimensions = #{relateDimensions,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -16,6 +16,7 @@
|
||||
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
|
||||
<result column="updated_by" jdbcType="VARCHAR" property="updatedBy" />
|
||||
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
|
||||
<result column="drill_down_dimensions" jdbcType="VARCHAR" property="drillDownDimensions" />
|
||||
</resultMap>
|
||||
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.tencent.supersonic.semantic.model.domain.dataobject.ModelDO">
|
||||
<result column="entity" jdbcType="LONGVARCHAR" property="entity" />
|
||||
@@ -80,7 +81,7 @@
|
||||
</sql>
|
||||
<sql id="Base_Column_List">
|
||||
id, name, biz_name, domain_id, alias, viewer, view_org, admin, admin_org, is_open,
|
||||
created_by, created_at, updated_by, updated_at
|
||||
created_by, created_at, updated_by, updated_at, drill_down_dimensions
|
||||
</sql>
|
||||
<sql id="Blob_Column_List">
|
||||
entity
|
||||
@@ -135,14 +136,14 @@
|
||||
domain_id, alias, viewer,
|
||||
view_org, admin, admin_org,
|
||||
is_open, created_by, created_at,
|
||||
updated_by, updated_at, entity
|
||||
)
|
||||
updated_by, updated_at, drill_down_dimensions,
|
||||
entity)
|
||||
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{bizName,jdbcType=VARCHAR},
|
||||
#{domainId,jdbcType=BIGINT}, #{alias,jdbcType=VARCHAR}, #{viewer,jdbcType=VARCHAR},
|
||||
#{viewOrg,jdbcType=VARCHAR}, #{admin,jdbcType=VARCHAR}, #{adminOrg,jdbcType=VARCHAR},
|
||||
#{isOpen,jdbcType=INTEGER}, #{createdBy,jdbcType=VARCHAR}, #{createdAt,jdbcType=TIMESTAMP},
|
||||
#{updatedBy,jdbcType=VARCHAR}, #{updatedAt,jdbcType=TIMESTAMP}, #{entity,jdbcType=LONGVARCHAR}
|
||||
)
|
||||
#{updatedBy,jdbcType=VARCHAR}, #{updatedAt,jdbcType=TIMESTAMP}, #{drillDownDimensions,jdbcType=VARCHAR},
|
||||
#{entity,jdbcType=LONGVARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.ModelDO">
|
||||
insert into s2_model
|
||||
@@ -189,6 +190,9 @@
|
||||
<if test="updatedAt != null">
|
||||
updated_at,
|
||||
</if>
|
||||
<if test="drillDownDimensions != null">
|
||||
drill_down_dimensions,
|
||||
</if>
|
||||
<if test="entity != null">
|
||||
entity,
|
||||
</if>
|
||||
@@ -236,6 +240,9 @@
|
||||
<if test="updatedAt != null">
|
||||
#{updatedAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="drillDownDimensions != null">
|
||||
#{drillDownDimensions,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="entity != null">
|
||||
#{entity,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
@@ -292,6 +299,9 @@
|
||||
<if test="record.updatedAt != null">
|
||||
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="record.drillDownDimensions != null">
|
||||
drill_down_dimensions = #{record.drillDownDimensions,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.entity != null">
|
||||
entity = #{record.entity,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
@@ -316,6 +326,7 @@
|
||||
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
|
||||
updated_by = #{record.updatedBy,jdbcType=VARCHAR},
|
||||
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
|
||||
drill_down_dimensions = #{record.drillDownDimensions,jdbcType=VARCHAR},
|
||||
entity = #{record.entity,jdbcType=LONGVARCHAR}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
@@ -336,7 +347,8 @@
|
||||
created_by = #{record.createdBy,jdbcType=VARCHAR},
|
||||
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
|
||||
updated_by = #{record.updatedBy,jdbcType=VARCHAR},
|
||||
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}
|
||||
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
|
||||
drill_down_dimensions = #{record.drillDownDimensions,jdbcType=VARCHAR}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
@@ -383,6 +395,9 @@
|
||||
<if test="updatedAt != null">
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="drillDownDimensions != null">
|
||||
drill_down_dimensions = #{drillDownDimensions,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="entity != null">
|
||||
entity = #{entity,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
@@ -404,6 +419,7 @@
|
||||
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
||||
updated_by = #{updatedBy,jdbcType=VARCHAR},
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
||||
drill_down_dimensions = #{drillDownDimensions,jdbcType=VARCHAR},
|
||||
entity = #{entity,jdbcType=LONGVARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
@@ -421,7 +437,8 @@
|
||||
created_by = #{createdBy,jdbcType=VARCHAR},
|
||||
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
||||
updated_by = #{updatedBy,jdbcType=VARCHAR},
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP}
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
||||
drill_down_dimensions = #{drillDownDimensions,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user