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/05/26 20:46:23 UTC

[atlas] branch branch-2.0 updated: ATLAS-4303: [Business Metadata Bulk Import] Incorrect Error "invalid business attribute name" thrown while trying to assign BM attribute to non-applicable type

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 51f483c  ATLAS-4303: [Business Metadata Bulk Import] Incorrect Error "invalid business attribute name" thrown while trying to assign BM attribute to non-applicable type
51f483c is described below

commit 51f483cb4232727105beacf0785e0ac3e1a444c0
Author: Radhika Kundam <rk...@cloudera.com>
AuthorDate: Wed May 26 09:59:59 2021 -0700

    ATLAS-4303: [Business Metadata Bulk Import] Incorrect Error "invalid business attribute name" thrown while trying to assign BM attribute to non-applicable type
    
    Signed-off-by: sidmishra <si...@apache.org>
    (cherry picked from commit 3bdc51ea1e1ed463f8c2c35c8bfc1fbb4b792cab)
---
 .../apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java    | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java
index 65b92ab..0f12bd3 100644
--- a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java
+++ b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java
@@ -1592,7 +1592,7 @@ public class AtlasEntityStoreV2 implements AtlasEntityStore {
             String bmAttributeValue = record[FileUtils.BM_ATTR_VALUE_COLUMN_INDEX];
             String uniqueAttrName   = AtlasTypeUtil.ATTRIBUTE_QUALIFIED_NAME;
 
-            if (record.length > FileUtils.UNIQUE_ATTR_NAME_COLUMN_INDEX) {
+            if (record.length > FileUtils.UNIQUE_ATTR_NAME_COLUMN_INDEX && StringUtils.isNotBlank(record[FileUtils.UNIQUE_ATTR_NAME_COLUMN_INDEX])) {
                 uniqueAttrName = record[FileUtils.UNIQUE_ATTR_NAME_COLUMN_INDEX];
             }
 
@@ -1628,7 +1628,7 @@ public class AtlasEntityStoreV2 implements AtlasEntityStore {
             AtlasBusinessAttribute businessAttribute = entityType.getBusinesAAttribute(bmAttribute);
 
             if (businessAttribute == null) {
-                failedMsgList.add("Line #" + (lineIndex + 1) + ": invalid business attribute name '" + bmAttribute + "'");
+                failedMsgList.add("Line #" + (lineIndex + 1) + ": invalid business-metadata '"+ bmAttribute + "' for entity type '" + entityType.getTypeName() + "'");
 
                 continue;
             }