atlas
atlas copied to clipboard
The method hivedb. Getcatalogname() does not exist in version 2.0
@xinda77 - can you please file a JIRA in https://issues.apache.org/jira/ with details of the issue?
the temporary way is update method getDatabaseName() in HiveMetaStoreBridge.java like this:
public static String getDatabaseName(Database hiveDB) {
/*String dbName = hiveDB.getName().toLowerCase();
String catalogName = hiveDB.getCatalogName() != null ? hiveDB.getCatalogName().toLowerCase() : null;
if (StringUtils.isNotEmpty(catalogName) && !StringUtils.equals(catalogName, DEFAULT_METASTORE_CATALOG)) {
dbName = catalogName + SEP + dbName;
}
return dbName;*/
String dbName = hiveDB.getName().toLowerCase();
//String catalogName = hiveDB.getCatalogName() != null ? hiveDB.getCatalogName().toLowerCase() : null;
String catalogName = null;
try {
if (hiveDB.getCatalogName() != null) {
catalogName = hiveDB.getCatalogName().toLowerCase();
}
} catch (NoSuchMethodError e) {
LOG.warn("Failed while getting catalog name of database");
}
if (StringUtils.isNotEmpty(catalogName) && !StringUtils.equals(catalogName, DEFAULT_METASTORE_CATALOG)) {
dbName = catalogName + SEP + dbName;
}
return dbName;
}
just try-catch it,package and instaead of hive-bridge-{project.version}.jar
@JavaLover4Ricky - your suggestion sounds good. Do you want to file a JIRA and create a patch? Thanks!