This is an automated email from the ASF dual-hosted git repository.

jackxu2011 pushed a commit to branch dev-1.3.2
in repository https://gitbox.apache.org/repos/asf/linkis.git


The following commit(s) were added to refs/heads/dev-1.3.2 by this push:
     new 90ac7b235 Dev 1.3.2 bug fix (#4097)
90ac7b235 is described below

commit 90ac7b23565c4d7e098b8b8f8a73483f48d4f6b2
Author: huangKai-2323 <[email protected]>
AuthorDate: Sat Jan 14 13:44:11 2023 +0800

    Dev 1.3.2 bug fix (#4097)
    
    * fix-1.1.8 bug
---
 linkis-dist/package/db/linkis_ddl.sql                            | 1 +
 .../apache/linkis/configuration/service/CategoryService.scala    | 9 ++++++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/linkis-dist/package/db/linkis_ddl.sql 
b/linkis-dist/package/db/linkis_ddl.sql
index e3b4e53df..9834be30d 100644
--- a/linkis-dist/package/db/linkis_ddl.sql
+++ b/linkis-dist/package/db/linkis_ddl.sql
@@ -106,6 +106,7 @@ CREATE TABLE `linkis_ps_job_history_group_history` (
   `engine_type` varchar(32) DEFAULT NULL COMMENT 'Engine type',
   `execution_code` text DEFAULT NULL COMMENT 'Job origin code or code path',
   `result_location` varchar(500) DEFAULT NULL COMMENT 'File path of the 
resultsets',
+  `observe_info` varchar(500) DEFAULT NULL COMMENT 'Click the notification 
information',
   PRIMARY KEY (`id`),
   KEY `idx_created_time` (`created_time`),
   KEY `idx_submit_user` (`submit_user`)
diff --git 
a/linkis-public-enhancements/linkis-configuration/src/main/scala/org/apache/linkis/configuration/service/CategoryService.scala
 
b/linkis-public-enhancements/linkis-configuration/src/main/scala/org/apache/linkis/configuration/service/CategoryService.scala
index db8413c3e..8c2e25fad 100644
--- 
a/linkis-public-enhancements/linkis-configuration/src/main/scala/org/apache/linkis/configuration/service/CategoryService.scala
+++ 
b/linkis-public-enhancements/linkis-configuration/src/main/scala/org/apache/linkis/configuration/service/CategoryService.scala
@@ -146,7 +146,14 @@ class CategoryService extends Logging {
     }
     val combinedLabel = configurationService.generateCombinedLabel(null, null, 
null, categoryName)
     val parsedLabel = LabelEntityParser.parseToConfigLabel(combinedLabel)
-    labelMapper.insertLabel(parsedLabel)
+    // New Query Avoid Repeated Insertion
+    val configValue =
+      labelMapper.getLabelByKeyValue(parsedLabel.getLabelKey, 
parsedLabel.getStringValue)
+    if (configValue != null) {
+      parsedLabel.setId(configValue.getId)
+    } else {
+      labelMapper.insertLabel(parsedLabel)
+    }
     if (parsedLabel.getId != null) {
       val categoryLabel = generateCategoryLabel(parsedLabel.getId, 
description, 1)
       configMapper.insertCategory(categoryLabel)


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to