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 2022/02/02 22:19:30 UTC

[atlas] branch branch-2.0 updated: ATLAS-4548: Added Empty attribute value for queryStr and queryId in case of null value

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 1eb4544  ATLAS-4548: Added Empty attribute value for queryStr and queryId in case of null value
1eb4544 is described below

commit 1eb454489432ec0b66a4909d160e985319dc2c13
Author: Sidharth Mishra <si...@gmail.com>
AuthorDate: Wed Feb 2 11:01:41 2022 -0800

    ATLAS-4548: Added Empty attribute value for queryStr and queryId in case of null value
    
    Signed-off-by: Sidharth Mishra <si...@apache.org>
    (cherry picked from commit 362f6c1b61247492367af1e5627960588bcc204b)
---
 .../main/java/org/apache/atlas/hive/hook/events/BaseHiveEvent.java    | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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 3e966ae..237c194 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
@@ -622,8 +622,8 @@ public abstract class BaseHiveEvent {
 
         if (context.isHiveProcessPopulateDeprecatedAttributes()) {
             ret.setAttribute(ATTRIBUTE_USER_NAME, getUserName());
-            ret.setAttribute(ATTRIBUTE_QUERY_TEXT, queryStr);
-            ret.setAttribute(ATTRIBUTE_QUERY_ID, getQueryId());
+            ret.setAttribute(ATTRIBUTE_QUERY_TEXT, StringUtils.isNotEmpty(queryStr)? queryStr : EMPTY_ATTRIBUTE_VALUE);
+            ret.setAttribute(ATTRIBUTE_QUERY_ID, StringUtils.isNotEmpty(getQueryId())? getQueryId() : EMPTY_ATTRIBUTE_VALUE);
         } else {
             ret.setAttribute(ATTRIBUTE_USER_NAME, EMPTY_ATTRIBUTE_VALUE);
             ret.setAttribute(ATTRIBUTE_QUERY_TEXT, EMPTY_ATTRIBUTE_VALUE);