You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by sh...@apache.org on 2016/08/05 13:09:16 UTC

[2/2] incubator-atlas git commit: ATLAS-1097 Fix a potential NPE issue flagged by Coverity scan (mneethiraj via shwethags)

ATLAS-1097 Fix a potential NPE issue flagged by Coverity scan (mneethiraj via shwethags)


Project: http://git-wip-us.apache.org/repos/asf/incubator-atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-atlas/commit/89f25d41
Tree: http://git-wip-us.apache.org/repos/asf/incubator-atlas/tree/89f25d41
Diff: http://git-wip-us.apache.org/repos/asf/incubator-atlas/diff/89f25d41

Branch: refs/heads/master
Commit: 89f25d411897dbd35a2baf7a96a0cf137c273f4a
Parents: d671b12
Author: Shwetha GS <ss...@hortonworks.com>
Authored: Fri Aug 5 16:25:03 2016 +0530
Committer: Shwetha GS <ss...@hortonworks.com>
Committed: Fri Aug 5 18:39:07 2016 +0530

----------------------------------------------------------------------
 .../main/java/org/apache/atlas/hive/hook/HiveHook.java  | 12 ++++++++----
 release-log.txt                                         |  1 +
 2 files changed, 9 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/89f25d41/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/HiveHook.java
----------------------------------------------------------------------
diff --git a/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/HiveHook.java b/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/HiveHook.java
index 7905bcf..14359c5 100755
--- a/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/HiveHook.java
+++ b/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/HiveHook.java
@@ -773,10 +773,14 @@ public class HiveHook extends AtlasHook implements ExecuteWithHookContext {
                                           SortedMap<WriteEntity, Referenceable> hiveOutputsMap) throws HiveException {
         HiveOperation op = eventContext.getOperation();
         if (isCreateOp(eventContext)) {
-            Table outTable = getEntityByType(sortedHiveOutputs, Type.TABLE).getTable();
-            //refresh table
-            outTable = dgiBridge.hiveClient.getTable(outTable.getDbName(), outTable.getTableName());
-            return HiveMetaStoreBridge.getTableProcessQualifiedName(dgiBridge.getClusterName(), outTable);
+            Entity entity = getEntityByType(sortedHiveOutputs, Type.TABLE);
+
+            if (entity != null) {
+                Table outTable = entity.getTable();
+                //refresh table
+                outTable = dgiBridge.hiveClient.getTable(outTable.getDbName(), outTable.getTableName());
+                return HiveMetaStoreBridge.getTableProcessQualifiedName(dgiBridge.getClusterName(), outTable);
+            }
         }
 
         StringBuilder buffer = new StringBuilder(op.getOperationName());

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/89f25d41/release-log.txt
----------------------------------------------------------------------
diff --git a/release-log.txt b/release-log.txt
index 102ca16..f6daa1c 100644
--- a/release-log.txt
+++ b/release-log.txt
@@ -6,6 +6,7 @@ INCOMPATIBLE CHANGES:
 
 
 ALL CHANGES:
+ATLAS-1097 Fix a potential NPE issue flagged by Coverity scan (mneethiraj via shwethags)
 ATLAS-1090 UI: Multi-Select Tagging. (Kalyanikashikar via kevalbhatt)
 ATLAS-1092 Add Table.CreateTime to process qualified Name for all hive_process (sumasai via shwethags)
 ATLAS-1096 Modify HveMetaStoreBridge.import to use getEntity instead of DSL (sumasai via shwethags)