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

pinal 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 c0858a883 ATLAS-4882: Export/Import: Export exits with 'Found 0 
entities'
c0858a883 is described below

commit c0858a883f87b87fc57a9160234286e35b0f16ec
Author: Pinal Shah <pinal.s...@freestoneinfotech.com>
AuthorDate: Tue Jun 18 13:11:46 2024 +0530

    ATLAS-4882: Export/Import: Export exits with 'Found 0 entities'
    
    Signed-off-by: Pinal Shah <pinal.s...@freestoneinfotech.com>
---
 .../repository/impexp/StartEntityFetchByExportRequest.java   |  2 +-
 .../org/apache/atlas/util/AtlasGremlin3QueryProvider.java    | 12 ++++++------
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git 
a/repository/src/main/java/org/apache/atlas/repository/impexp/StartEntityFetchByExportRequest.java
 
b/repository/src/main/java/org/apache/atlas/repository/impexp/StartEntityFetchByExportRequest.java
index d01d6775a..07b7023e5 100644
--- 
a/repository/src/main/java/org/apache/atlas/repository/impexp/StartEntityFetchByExportRequest.java
+++ 
b/repository/src/main/java/org/apache/atlas/repository/impexp/StartEntityFetchByExportRequest.java
@@ -189,7 +189,7 @@ public class StartEntityFetchByExportRequest {
         try {
             return (List<String>) 
atlasGraph.executeGremlinScript(getScriptEngine(), bindings, query, false);
         } catch (ScriptException e) {
-            LOG.error("Script execution failed for query: ", query, e);
+            LOG.error("Script execution failed for query: {}, {} ", query, e);
             return null;
         }
     }
diff --git 
a/repository/src/main/java/org/apache/atlas/util/AtlasGremlin3QueryProvider.java
 
b/repository/src/main/java/org/apache/atlas/util/AtlasGremlin3QueryProvider.java
index 5b10c353e..87bf3d74a 100644
--- 
a/repository/src/main/java/org/apache/atlas/util/AtlasGremlin3QueryProvider.java
+++ 
b/repository/src/main/java/org/apache/atlas/util/AtlasGremlin3QueryProvider.java
@@ -28,15 +28,15 @@ public class AtlasGremlin3QueryProvider extends 
AtlasGremlin2QueryProvider {
             case ENTITY_DELETED_METRIC:
                 return "g.V().has('__typeName', within(%s)).has('__state', 
'DELETED').groupCount().by('__typeName').toList()";
             case EXPORT_TYPE_STARTS_WITH:
-                return 
"g.V().has('__typeName',typeName).filter({it.get().value(attrName).startsWith(attrValue)}).has('__guid').values('__guid').toList()";
+                return 
"g.V().has('__typeName',typeName).filter({it.get().value(attrName).startsWith(attrValue)}).values('__guid').toList()";
             case EXPORT_TYPE_ENDS_WITH:
-                return 
"g.V().has('__typeName',typeName).filter({it.get().value(attrName).endsWith(attrValue)}).has('__guid').values('__guid').toList()";
+                return 
"g.V().has('__typeName',typeName).filter({it.get().value(attrName).endsWith(attrValue)}).values('__guid').toList()";
             case EXPORT_TYPE_CONTAINS:
-                return 
"g.V().has('__typeName',typeName).filter({it.get().value(attrName).contains(attrValue)}).has('__guid').values('__guid').toList()";
+                return 
"g.V().has('__typeName',typeName).filter({it.get().value(attrName).contains(attrValue)}).values('__guid').toList()";
             case EXPORT_TYPE_MATCHES:
-                return 
"g.V().has('__typeName',typeName).filter({it.get().value(attrName).matches(attrValue)}).has('__guid').values('__guid').toList()";
+                return 
"g.V().has('__typeName',typeName).filter({it.get().value(attrName).matches(attrValue)}).values('__guid').toList()";
             case EXPORT_TYPE_DEFAULT:
-                return "g.V().has('__typeName',typeName).has(attrName, 
attrValue).has('__guid').values('__guid').toList()";
+                return "g.V().has('__typeName',typeName).has(attrName, 
attrValue).values('__guid').toList()";
             case EXPORT_BY_GUID_FULL:
                 return "g.V().has('__guid', 
startGuid).bothE().bothV().has('__guid').project('__guid', 
'isProcess').by('__guid').by(map 
{it.get().values('__superTypeNames').toSet().contains('Process')}).dedup().toList()";
             case EXPORT_BY_GUID_CONNECTED_IN_EDGE:
@@ -44,7 +44,7 @@ public class AtlasGremlin3QueryProvider extends 
AtlasGremlin2QueryProvider {
             case EXPORT_BY_GUID_CONNECTED_OUT_EDGE:
                 return "g.V().has('__guid', 
startGuid).outE().inV().has('__guid').project('__guid', 
'isProcess').by('__guid').by(map 
{it.get().values('__superTypeNames').toSet().contains('Process')}).dedup().toList()";
             case EXPORT_TYPE_ALL_FOR_TYPE:
-                return "g.V().has('__typeName', 
within(typeName)).has('__guid').values('__guid').toList()";
+                return "g.V().has('__typeName', 
within(typeName)).values('__guid').toList()";
             case FULL_LINEAGE_DATASET:
                 return "g.V().has('__guid', 
guid).repeat(__.inE(incomingEdgeLabel).as('e1').outV().outE(outgoingEdgeLabel).as('e2').inV()).emit().select('e1',
 'e2').toList()";
             case PARTIAL_LINEAGE_DATASET:

Reply via email to