pan3793 commented on code in PR #7029:
URL: https://github.com/apache/kyuubi/pull/7029#discussion_r2054518355


##########
kyuubi-server/src/main/scala/org/apache/kyuubi/server/metadata/jdbc/JDBCMetadataStore.scala:
##########
@@ -419,6 +419,129 @@ class JDBCMetadataStore(conf: KyuubiConf) extends 
MetadataStore with Logging {
     }
   }
 
+  private def insertKubernetesMetadata(metadata: KubernetesMetadata): Unit = {
+    val insertQuery =
+      s"""
+         |INSERT INTO $KUBERNETES_METADATA_TABLE(
+         |identifier,
+         |context,
+         |namespace,
+         |pod_name,
+         |app_id,
+         |app_name,
+         |app_state,
+         |app_error,
+         |create_time,
+         |update_time
+         |)
+         |SELECT ?, ?, ?, ?, ?, ?, ?, ?, ?, ?
+         |WHERE NOT EXISTS (
+         |  SELECT 1 FROM $KUBERNETES_METADATA_TABLE WHERE identifier = ?

Review Comment:
   seems this is used to avoid multi kyuubi instances inserting duplicate 
entries?
   the semantics should be fine, but it's better to check if there are 
performance issues on MySQL 5.x
   
   PS: I'm very pessimistic about MySQL's optimizer, see example 
https://github.com/apache/hive/pull/5204/files#r2054512975



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@kyuubi.apache.org
For additional commands, e-mail: notifications-h...@kyuubi.apache.org

Reply via email to