Commit c6661ff1 by Mandar Ambawane Committed by Madhan Neethiraj

ATLAS-3539: fixed Hive metastore hook to populate hive_db.ownerType, and not…

ATLAS-3539: fixed Hive metastore hook to populate hive_db.ownerType, and not update hive_db.description when null Signed-off-by: 's avatarMadhan Neethiraj <madhan@apache.org>
parent af203374
......@@ -314,7 +314,11 @@ public abstract class BaseHiveEvent {
ret.setAttribute(ATTRIBUTE_QUALIFIED_NAME, dbQualifiedName);
ret.setAttribute(ATTRIBUTE_NAME, dbName);
ret.setAttribute(ATTRIBUTE_DESCRIPTION, db.getDescription());
if (StringUtils.isNotEmpty(db.getDescription())) {
ret.setAttribute(ATTRIBUTE_DESCRIPTION, db.getDescription());
}
ret.setAttribute(ATTRIBUTE_OWNER, db.getOwnerName());
ret.setAttribute(ATTRIBUTE_CLUSTER_NAME, getMetadataNamespace());
......
......@@ -61,6 +61,10 @@ public class CreateDatabase extends BaseHiveEvent {
Database db = dbEvent.getDatabase();
if (db != null) {
db = context.getMetastoreHandler().get_database(db.getName());
}
if (db != null) {
AtlasEntity dbEntity = toDbEntity(db);
ret.addEntity(dbEntity);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment