(improvement)(semantic) support metric relate dimension setting (#229)

Co-authored-by: jolunoluo
This commit is contained in:
LXW
2023-10-16 16:43:09 +08:00
committed by GitHub
parent 86bf40c8fb
commit f2e8207245
38 changed files with 508 additions and 87 deletions

View File

@@ -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>

View File

@@ -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>