You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@kyuubi.apache.org by GitBox <gi...@apache.org> on 2022/12/30 02:52:55 UTC

[GitHub] [kyuubi] pan3793 commented on a diff in pull request #4022: [KYUUBI #3968] Upgrading and migration script for Jdbc

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


##########
kyuubi-server/src/main/scala/org/apache/kyuubi/server/metadata/jdbc/JDBCMetadataStore.scala:
##########
@@ -78,11 +78,14 @@ class JDBCMetadataStore(conf: KyuubiConf) extends MetadataStore with Logging {
 
   private def initSchema(): Unit = {
     val classLoader = Utils.getContextOrKyuubiClassLoader
+    val kyuubiShortVersion = KYUUBI_VERSION.split("-")(0)
     val initSchemaStream: Option[InputStream] = dbType match {
       case DERBY =>
-        Option(classLoader.getResourceAsStream("sql/derby/metadata-store-schema-derby.sql"))
+        Option(classLoader
+          .getResourceAsStream(s"sql/derby/metadata-store-schema-${kyuubiShortVersion}.derby.sql"))
       case MYSQL =>
-        Option(classLoader.getResourceAsStream("sql/mysql/metadata-store-schema-mysql.sql"))
+        Option(classLoader
+          .getResourceAsStream(s"sql/mysql/metadata-store-schema-${kyuubiShortVersion}.mysql.sql"))

Review Comment:
   I prefer to dynamically calculate the schema version, but the current calculation is not correct, think about 1.7.1, the expected result is 1.7.0



-- 
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-unsubscribe@kyuubi.apache.org

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


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