You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@atlas.apache.org by GitBox <gi...@apache.org> on 2021/03/05 02:31:06 UTC

[GitHub] [atlas] JavaLover4Ricky edited a comment on pull request #78: The method hivedb. Getcatalogname() does not exist in version 2.0

JavaLover4Ricky edited a comment on pull request #78:
URL: https://github.com/apache/atlas/pull/78#issuecomment-791100478


   the ttemporary way is you can 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


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org