You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by si...@apache.org on 2021/11/09 20:58:52 UTC

[atlas] branch branch-2.0 updated: ATLAS-4470: Creating Hive_Process entity is getting failed due to empty/null startTime

This is an automated email from the ASF dual-hosted git repository.

sidmishra pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/atlas.git


The following commit(s) were added to refs/heads/branch-2.0 by this push:
     new e4cfb57  ATLAS-4470: Creating Hive_Process entity is getting failed due to empty/null startTime
e4cfb57 is described below

commit e4cfb57d4324079af51c488cae28353689a25f1b
Author: Radhika Kundam <rk...@cloudera.com>
AuthorDate: Tue Nov 2 13:19:47 2021 -0700

    ATLAS-4470: Creating Hive_Process entity is getting failed due to empty/null startTime
    
    Signed-off-by: Sidharth Mishra <si...@apache.org>
    (cherry picked from commit 10a7c76c8e07a60c65109391e76970714f2122e2)
---
 .../java/org/apache/atlas/hive/hook/events/BaseHiveEvent.java     | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/BaseHiveEvent.java b/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/BaseHiveEvent.java
index 3f35813..3e966ae 100644
--- a/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/BaseHiveEvent.java
+++ b/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/BaseHiveEvent.java
@@ -767,7 +767,13 @@ public abstract class BaseHiveEvent {
     }
 
     protected Long getQueryStartTime() {
-        return isHiveContextValid() ? context.getHiveContext().getQueryPlan().getQueryStartTime() : System.currentTimeMillis();
+        Long queryStartTime = null;
+
+        if (isHiveContextValid() && context.getHiveContext().getQueryPlan() != null) {
+            queryStartTime = context.getHiveContext().getQueryPlan().getQueryStartTime();
+        }
+
+        return queryStartTime == null ? System.currentTimeMillis() : queryStartTime;
     }
 
     protected String getQueryId() {