turboFei commented on code in PR #4022:
URL: https://github.com/apache/kyuubi/pull/4022#discussion_r1063024572
##########
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:
I refer this:
https://stackoverflow.com/questions/1429172/how-to-list-the-files-inside-a-jar-file/28057735#28057735
--
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]