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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to