use of org.apache.hadoop.hive.metastore.model.MFunction in project hive by apache.
the class ObjectStore method getMFunction.
private MFunction getMFunction(String db, String function) {
MFunction mfunc = null;
boolean commited = false;
Query query = null;
try {
openTransaction();
db = HiveStringUtils.normalizeIdentifier(db);
function = HiveStringUtils.normalizeIdentifier(function);
query = pm.newQuery(MFunction.class, "functionName == function && database.name == db");
query.declareParameters("java.lang.String function, java.lang.String db");
query.setUnique(true);
mfunc = (MFunction) query.execute(function, db);
pm.retrieve(mfunc);
commited = commitTransaction();
} finally {
if (!commited) {
rollbackTransaction();
}
if (query != null) {
query.closeAll();
}
}
return mfunc;
}
Aggregations