This is an automated email from the ASF dual-hosted git repository. sidmishra pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/atlas.git
The following commit(s) were added to refs/heads/master by this push: new 10a7c76 ATLAS-4470: Creating Hive_Process entity is getting failed due to empty/null startTime 10a7c76 is described below commit 10a7c76c8e07a60c65109391e76970714f2122e2 Author: Radhika Kundam <rkun...@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 <sidmis...@apache.org> --- .../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() {