Skip to content

Commit

Permalink
[fix](multicatalog) fix metacache is null issue when show_dbs (apache…
Browse files Browse the repository at this point in the history
…#38619)

Brought by: apache#38244

how to reproduce:
create a hms catalog named hive with property use_meta_cache = false,
after that restart fe, and run sql `switch hive; show databases;`, will
get error:
```sql
ERROR 1105 (HY000): NullPointerException, msg: java.lang.NullPointerException: Cannot invoke "org.apache.doris.datasource.metacache.MetaCache.listNames()" because "this.metaCache" is null
```

reason, property use_meta_cache of newly created hms catalog after pr
apache#38244 was force convert to true, but field `useMetaCache` of class
ExternalCatalog is not converted at the same time.
  • Loading branch information
Yulei-Yang authored Aug 1, 2024
1 parent 1c10414 commit 4b58cee
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ public void checkProperties() throws DdlException {
if (properties.getOrDefault(ExternalCatalog.USE_META_CACHE, "true").equals("false")) {
LOG.warn("force to set use_meta_cache to true for catalog: {} when creating", name);
getCatalogProperty().addProperty(ExternalCatalog.USE_META_CACHE, "true");
useMetaCache = Optional.of(true);
}
}

Expand Down

0 comments on commit 4b58cee

Please sign in to comment.