Search in sources :

Example 6 with MCatalog

use of org.apache.hadoop.hive.metastore.model.MCatalog in project hive by apache.

the class ObjectStore method catToMCat.

private MCatalog catToMCat(Catalog cat) {
    MCatalog mCat = new MCatalog();
    mCat.setName(normalizeIdentifier(cat.getName()));
    if (cat.isSetDescription()) {
        mCat.setDescription(cat.getDescription());
    }
    mCat.setLocationUri(cat.getLocationUri());
    mCat.setCreateTime(cat.getCreateTime());
    return mCat;
}
Also used : MCatalog(org.apache.hadoop.hive.metastore.model.MCatalog)

Example 7 with MCatalog

use of org.apache.hadoop.hive.metastore.model.MCatalog in project hive by apache.

the class ObjectStore method getCatalog.

@Override
public Catalog getCatalog(String catalogName) throws NoSuchObjectException, MetaException {
    LOG.debug("Fetching catalog {}", catalogName);
    MCatalog mCat = getMCatalog(catalogName);
    if (mCat == null) {
        throw new NoSuchObjectException("No catalog " + catalogName);
    }
    return mCatToCat(mCat);
}
Also used : NoSuchObjectException(org.apache.hadoop.hive.metastore.api.NoSuchObjectException) MCatalog(org.apache.hadoop.hive.metastore.model.MCatalog)

Aggregations

MCatalog (org.apache.hadoop.hive.metastore.model.MCatalog)7 NoSuchObjectException (org.apache.hadoop.hive.metastore.api.NoSuchObjectException)2 Query (javax.jdo.Query)1 Catalog (org.apache.hadoop.hive.metastore.api.Catalog)1 InvalidOperationException (org.apache.hadoop.hive.metastore.api.InvalidOperationException)1 ScheduledQuery (org.apache.hadoop.hive.metastore.api.ScheduledQuery)1 MScheduledQuery (org.apache.hadoop.hive.metastore.model.MScheduledQuery)1 MetaStoreUtils.getDefaultCatalog (org.apache.hadoop.hive.metastore.utils.MetaStoreUtils.getDefaultCatalog)1