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 2023/01/05 04:47:30 UTC

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

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


##########
kyuubi-server/src/main/scala/org/apache/kyuubi/server/metadata/jdbc/JDBCMetadataStore.scala:
##########
@@ -78,17 +79,17 @@ class JDBCMetadataStore(conf: KyuubiConf) extends MetadataStore with Logging {
 
   private def initSchema(): Unit = {
     val classLoader = Utils.getContextOrKyuubiClassLoader
-    val initSchemaStream: Option[InputStream] = dbType match {
-      case DERBY =>
-        Option(classLoader.getResourceAsStream("sql/derby/metadata-store-schema-derby.sql"))
-      case MYSQL =>
-        Option(classLoader.getResourceAsStream("sql/mysql/metadata-store-schema-mysql.sql"))
+    val initSchemaFile: Option[File] = dbType match {
+      case DERBY | MYSQL =>
+        getInitSchemaStream(classLoader.getResource(s"sql/${dbType.toString.toLowerCase}"))
       case CUSTOM => None
     }
-    initSchemaStream.foreach { inputStream =>
+    initSchemaFile.foreach { schemaFile =>
+      info(s"Init schema file: ${schemaFile.getAbsolutePath}")
+      val reader = new BufferedReader(new FileReader(schemaFile))

Review Comment:
   will raise a pr to followup it, we have to use inputStream instead of FileReader



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