You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by sa...@apache.org on 2021/01/14 06:50:59 UTC

[atlas] branch branch-2.0 updated: ATLAS-4099: Removed trailing path separator from adls_gen2_directory qualifiedName

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

sarath 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 8a27eff  ATLAS-4099: Removed trailing path separator from adls_gen2_directory qualifiedName
8a27eff is described below

commit 8a27effd7b27bb5f880ff01d57135be258a57607
Author: sidmishra <si...@cloudera.com>
AuthorDate: Tue Jan 12 16:43:05 2021 -0800

    ATLAS-4099: Removed trailing path separator from adls_gen2_directory qualifiedName
    
    Signed-off-by: Sarath Subramanian <sa...@apache.org>
    (cherry picked from commit d27790dfdde09a58db15064bbdaf77d224f61ecc)
---
 .../main/java/org/apache/atlas/utils/AtlasPathExtractorUtil.java    | 6 +++---
 .../java/org/apache/atlas/utils/AtlasPathExtractorUtilTest.java     | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/common/src/main/java/org/apache/atlas/utils/AtlasPathExtractorUtil.java b/common/src/main/java/org/apache/atlas/utils/AtlasPathExtractorUtil.java
index 0e4b507..81f847e 100644
--- a/common/src/main/java/org/apache/atlas/utils/AtlasPathExtractorUtil.java
+++ b/common/src/main/java/org/apache/atlas/utils/AtlasPathExtractorUtil.java
@@ -315,7 +315,7 @@ public class AtlasPathExtractorUtil {
                     continue;
                 }
 
-                String subDirPath          = parentPath + subDirName + Path.SEPARATOR;
+                String subDirPath          = parentPath + subDirName;
                 String subDirQualifiedName = schemeAndContainerName + subDirPath + QNAME_SEP_METADATA_NAMESPACE + metadataNamespace;
 
                 ret = new AtlasEntity(ADLS_GEN2_DIRECTORY);
@@ -331,7 +331,7 @@ public class AtlasPathExtractorUtil {
                 context.putEntity(subDirQualifiedName, ret);
 
                 parentObjId = AtlasTypeUtil.getAtlasRelatedObjectId(ret, RELATIONSHIP_ADLS_GEN2_PARENT_CHILDREN);
-                parentPath  = subDirPath;
+                parentPath  = subDirPath + Path.SEPARATOR;
             }
 
             if (ret == null) {
@@ -516,4 +516,4 @@ public class AtlasPathExtractorUtil {
 
         return path.toLowerCase();
     }
-}
\ No newline at end of file
+}
diff --git a/common/src/test/java/org/apache/atlas/utils/AtlasPathExtractorUtilTest.java b/common/src/test/java/org/apache/atlas/utils/AtlasPathExtractorUtilTest.java
index 2d2ff2c..dbc5000 100644
--- a/common/src/test/java/org/apache/atlas/utils/AtlasPathExtractorUtilTest.java
+++ b/common/src/test/java/org/apache/atlas/utils/AtlasPathExtractorUtilTest.java
@@ -304,17 +304,17 @@ public class AtlasPathExtractorUtilTest {
     }
 
     private void verifyABFSAdlsGen2Dir(String abfsScheme, String path, AtlasEntity entity){
-        String pathQName = abfsScheme + "data@razrangersan/tmp/cdp-demo/sample.csv/" + QNAME_METADATA_NAMESPACE;
+        String pathQName = abfsScheme + "data@razrangersan/tmp/cdp-demo/sample.csv" + QNAME_METADATA_NAMESPACE;
         String entityQName = (String) entity.getAttribute(ATTRIBUTE_QUALIFIED_NAME);
 
         if (pathQName.equalsIgnoreCase(entityQName)){
             assertEquals(entity.getAttribute(ATTRIBUTE_NAME), "sample.csv");
         } else {
-            pathQName = abfsScheme + "data@razrangersan/tmp/cdp-demo/" + QNAME_METADATA_NAMESPACE;
+            pathQName = abfsScheme + "data@razrangersan/tmp/cdp-demo" + QNAME_METADATA_NAMESPACE;
             if (pathQName.equalsIgnoreCase(entityQName)){
                 assertEquals(entity.getAttribute(ATTRIBUTE_NAME), "cdp-demo");
             } else {
-                assertEquals(entity.getAttribute(ATTRIBUTE_QUALIFIED_NAME), abfsScheme + "data@razrangersan/tmp/" + QNAME_METADATA_NAMESPACE);
+                assertEquals(entity.getAttribute(ATTRIBUTE_QUALIFIED_NAME), abfsScheme + "data@razrangersan/tmp" + QNAME_METADATA_NAMESPACE);
                 assertEquals(entity.getAttribute(ATTRIBUTE_NAME), "tmp");
             }
         }