[ https://issues.apache.org/jira/browse/ATLAS-145?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14743407#comment-14743407 ]
Suma Shivaprasad edited comment on ATLAS-145 at 9/14/15 11:53 AM: ------------------------------------------------------------------ We need to change the DSL to gremlin translation here to g.V.has("typeName","DB").as("db").in("Table.db").back("db").and(_()has("name", T.eq, "Reporting")).map().toList() Working query: g.V().has("__typeName", "DB").as("db1").in("__Table.db").back("db1").and(_().has("DB.name", T.eq, "Reporting")).map.toList() discoveryService.searchByGremlin( {noformat} "L:{_var_0 = [] as Set;g.V().has(\"__typeName\", \"DB\").fill(_var_0);g.V().has(\"__superTypeNames\", \"DB\").fill(_var_0);_var_0._().as(\"db1\").in(\"__Table.db\").back(\"db1\").and(_().has(\"DB.name\", T.eq, \"Reporting\")).map.toList()}") {noformat} works was (Author: suma.shivaprasad): We need to change the DSL to gremlin translation here to g.V.has("typeName","DB").as("db").in("Table.db").back("db").and(_()has("name", T.eq, "Reporting")).map().toList() Working query: g.V().has("__typeName", "DB").as("db1").in("__Table.db").back("db1").and(_().has("DB.name", T.eq, "Reporting")).map.toList() discoveryService.searchByGremlin("L:{_var_0 = [] as Set;g.V().has(\"__typeName\", \"DB\").fill(_var_0);g.V().has(\"__superTypeNames\", \"DB\").fill(_var_0);_var_0._().as(\"db1\").in(\"__Table.db\").back(\"db1\").and(_().has(\"DB.name\", T.eq, \"Reporting\")).map.toList()}") works > DSL - Fix back reference DSL to gremlin translation issues > ---------------------------------------------------------- > > Key: ATLAS-145 > URL: https://issues.apache.org/jira/browse/ATLAS-145 > Project: Atlas > Issue Type: Bug > Reporter: Suma Shivaprasad > > GremlinQuery.scala > /* > * TODO > * Translation Issues: > * 1. back references in filters. For e.g. testBackreference: 'DB as db > Table where (db.name = "Reporting")' > * this is translated to: > * > g.V.has("typeName","DB").as("db").in("Table.db").and(_().back("db").has("name", > T.eq, "Reporting")).map().toList() > * But the '_().back("db") within the and is ignored, the has condition > is applied on the current element. > * The solution is to to do predicate pushdown and apply the filter > immediately on top of the referred Expression. > */ -- This message was sent by Atlassian JIRA (v6.3.4#6332)