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


##########
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:
   Another way is listing all schema files and only always using the greatest 
version



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