dimas-b commented on code in PR #1942:
URL: https://github.com/apache/polaris/pull/1942#discussion_r2175204137


##########
persistence/relational-jdbc/src/main/java/org/apache/polaris/persistence/relational/jdbc/DatasourceOperations.java:
##########
@@ -80,16 +81,13 @@ DatabaseType getDatabaseType() {
    * @param scriptFilePath : Path of SQL script.
    * @throws SQLException : Exception while executing the script.
    */
-  public void executeScript(String scriptFilePath) throws SQLException {
-    ClassLoader classLoader = DatasourceOperations.class.getClassLoader();
+  public void executeScript(InputStream scriptInputStream) throws SQLException 
{
     runWithinTransaction(
         connection -> {
           try (Statement statement = connection.createStatement()) {
             BufferedReader reader =
                 new BufferedReader(
-                    new InputStreamReader(
-                        
Objects.requireNonNull(classLoader.getResourceAsStream(scriptFilePath)),
-                        UTF_8));
+                    new 
InputStreamReader(Objects.requireNonNull(scriptInputStream), UTF_8));

Review Comment:
   I did not look into the previous revision of this code in details 
:sweat_smile:  but in general, I believe theses streams need to be closed for 
good measure (before JVM exit)... WDYT?



-- 
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: issues-unsubscr...@polaris.apache.org

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

Reply via email to