Skip to content

Commit

Permalink
[core] Fix warehouse path bug for JdbcCatalog
Browse files Browse the repository at this point in the history
  • Loading branch information
JingsongLi committed Mar 8, 2024
1 parent fa377aa commit 07d87bc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ public String identifier() {
@Override
public Catalog create(FileIO fileIO, Path warehouse, CatalogContext context) {
String catalogKey = context.options().get(JdbcCatalogOptions.CATALOG_KEY);
return new JdbcCatalog(fileIO, catalogKey, context.options().toMap(), warehouse.getName());
return new JdbcCatalog(fileIO, catalogKey, context.options().toMap(), warehouse.toString());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ public class JdbcCatalogTest extends CatalogTestBase {
@BeforeEach
public void setUp() throws Exception {
super.setUp();
catalog = initCatalog("test-jdbc-catalog", Maps.newHashMap());
catalog = initCatalog(Maps.newHashMap());
}

private JdbcCatalog initCatalog(String storeKey, Map<String, String> props) {
private JdbcCatalog initCatalog(Map<String, String> props) {
Map<String, String> properties = Maps.newHashMap();
properties.put(
CatalogOptions.URI.key(),
Expand All @@ -56,8 +56,9 @@ private JdbcCatalog initCatalog(String storeKey, Map<String, String> props) {
properties.put(CatalogOptions.WAREHOUSE.key(), warehouse);
properties.put(CatalogOptions.LOCK_ENABLED.key(), "true");
properties.putAll(props);
JdbcCatalog jdbcCatalog = new JdbcCatalog(fileIO, storeKey, properties, warehouse);
return jdbcCatalog;
JdbcCatalog catalog = new JdbcCatalog(fileIO, "test-jdbc-catalog", properties, warehouse);
assertThat(catalog.warehouse()).isEqualTo(warehouse);
return catalog;
}

@Test
Expand Down

0 comments on commit 07d87bc

Please sign in to comment.