Commit d0a9b999 by Madhan Neethiraj Committed by Suma Shivaprasad

ATLAS-1053: Fix for issues flagged by Coverity scan - potential NPE

parent 56e97e22
......@@ -123,9 +123,12 @@ public class HiveMetaStoreBridge {
List<String> databases = hiveClient.getAllDatabases();
for (String databaseName : databases) {
Referenceable dbReference = registerDatabase(databaseName);
if (dbReference != null) {
importTables(dbReference, databaseName, failOnError);
}
}
}
/**
* Create a Hive Database entity
......@@ -146,6 +149,8 @@ public class HiveMetaStoreBridge {
private Referenceable registerDatabase(String databaseName) throws Exception {
Referenceable dbRef = getDatabaseReference(clusterName, databaseName);
Database db = hiveClient.getDatabase(databaseName);
if (db != null) {
if (dbRef == null) {
dbRef = createDBInstance(db);
dbRef = registerInstance(dbRef);
......@@ -154,6 +159,7 @@ public class HiveMetaStoreBridge {
dbRef = createOrUpdateDBInstance(db, dbRef);
updateInstance(dbRef);
}
}
return dbRef;
}
......
......@@ -499,6 +499,9 @@ public class HiveHook extends AtlasHook implements ExecuteWithHookContext {
if (db != null) {
db = dgiBridge.hiveClient.getDatabase(db.getName());
}
if (db != null) {
Referenceable dbEntity = dgiBridge.createDBInstance(db);
entities.add(dbEntity);
......
......@@ -6,6 +6,7 @@ INCOMPATIBLE CHANGES:
ALL CHANGES:
ATLAS-1053 Fix issues flagged by Coverity scan - potential NPE (mneethiraj via sumasai)
ATLAS-1052 Fix NPE in HiveHook due to null Session State (sumasai)
ATLAS-1051 Sqoop Hook does not package HDFS model jars which is required (sumasai)
ATLAS-1049 List types by supertype (shwethags via sumasai)
......
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