difin commented on code in PR #6292:
URL: https://github.com/apache/hive/pull/6292#discussion_r2783096874


##########
iceberg/iceberg-catalog/src/test/java/org/apache/iceberg/hive/TestHiveMetastore.java:
##########
@@ -195,6 +195,24 @@ public HiveConf hiveConf() {
     return hiveConf;
   }
 
+  /**
+   * Gets the actual connection URL used by the metastore handler.
+   * This is needed because hiveConf() returns the original conf passed to 
start(),
+   * which may not have the connection URL that was set in the handler's 
serverConf.
+   */
+  public String getConnectionURL() {

Review Comment:
   No, `MetaStoreInit.getConnectionURL(Configuration conf)` returns default db 
url - Derby in-memory:
   
   
`jdbc:derby:memory:/Users/dfingerman/workspace/hive-upstream-difin/iceberg/iceberg-handler/target/tmp/junit_metastore_db;create=true`
   
   ```
     static String getConnectionURL(Configuration conf) {
       return MetastoreConf.getVar(conf, ConfVars.CONNECT_URL_KEY, "");
     }
   ```
   
   Current method returns the correct file-based derby db url: 
   `shell.metastore().getConnectionURL()`: 
   
   
`jdbc:derby:/var/folders/ks/4pwh80t957gc8q2z7jdblpw80000gq/T/hive3437069780704791128/metastore_db;create=true`
   
   This is what took me 1-2 days to find why compaction command wasn't able to 
resolve correct database during compaction command analysis.



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