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

sarath 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 b96ce27  ATLAS-3380: Regression: After moving a table to a different 
database , db attribute in the table entity still points to the old db
b96ce27 is described below

commit b96ce272d42283a3ee67e984d919c21bb65b587d
Author: Sarath Subramanian <[email protected]>
AuthorDate: Mon Aug 19 14:52:20 2019 -0700

    ATLAS-3380: Regression: After moving a table to a different database , db 
attribute in the table entity still points to the old db
---
 .../main/java/org/apache/atlas/hive/hook/events/AlterTableRename.java  | 3 ++-
 intg/src/main/java/org/apache/atlas/model/instance/AtlasEntity.java    | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git 
a/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/AlterTableRename.java
 
b/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/AlterTableRename.java
index f496b78..6961fa7 100644
--- 
a/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/AlterTableRename.java
+++ 
b/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/AlterTableRename.java
@@ -169,7 +169,8 @@ public class AlterTableRename extends BaseHiveEvent {
 
     private void renameStorageDesc(AtlasEntityWithExtInfo oldEntityExtInfo, 
AtlasEntityWithExtInfo newEntityExtInfo, List<HookNotification> notifications) {
         AtlasEntity oldSd = getStorageDescEntity(oldEntityExtInfo);
-        AtlasEntity newSd = getStorageDescEntity(newEntityExtInfo);
+        AtlasEntity newSd = new 
AtlasEntity(getStorageDescEntity(newEntityExtInfo)); // make a copy of newSd, 
since we will be setting relationshipAttributes to 'null' below
+                                                                               
      // and we need relationship attributes later during entity full update
 
         if (oldSd != null && newSd != null) {
             AtlasObjectId oldSdId = new AtlasObjectId(oldSd.getTypeName(), 
ATTRIBUTE_QUALIFIED_NAME, oldSd.getAttribute(ATTRIBUTE_QUALIFIED_NAME));
diff --git 
a/intg/src/main/java/org/apache/atlas/model/instance/AtlasEntity.java 
b/intg/src/main/java/org/apache/atlas/model/instance/AtlasEntity.java
index 5b24ef1..659f7d5 100644
--- a/intg/src/main/java/org/apache/atlas/model/instance/AtlasEntity.java
+++ b/intg/src/main/java/org/apache/atlas/model/instance/AtlasEntity.java
@@ -201,6 +201,8 @@ public class AtlasEntity extends AtlasStruct implements 
Serializable {
             setUpdateTime(other.getUpdateTime());
             setVersion(other.getVersion());
             setClassifications(other.getClassifications());
+            setRelationshipAttributes(other.getRelationshipAttributes());
+            setMeanings(other.getMeanings());
         }
     }
 

Reply via email to