eric-maynard commented on code in PR #1942:
URL: https://github.com/apache/polaris/pull/1942#discussion_r2173826109


##########
persistence/relational-jdbc/src/test/java/org/apache/polaris/persistence/relational/jdbc/AtomicMetastoreManagerWithJdbcBasePersistenceImplTest.java:
##########
@@ -49,8 +50,11 @@ protected PolarisTestMetaStoreManager 
createPolarisTestMetaStoreManager() {
     try {
       datasourceOperations =
           new DatasourceOperations(createH2DataSource(), new 
H2JdbcConfiguration());
-      datasourceOperations.executeScript(
-          String.format("%s/schema-v2.sql", DatabaseType.H2.getDisplayName()));
+      ClassLoader classLoader = DatasourceOperations.class.getClassLoader();
+      InputStream scriptStream =
+          classLoader.getResourceAsStream(

Review Comment:
   Per the javadoc, I think it's better to have this method take on the 
responsibility for closing the stream after it's used rather than scatter 
try-with-resources everywhere. The loan pattern would be better, but we're 
already getting pretty far away from the intent of this change.



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

Reply via email to