-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/72987/
-----------------------------------------------------------

Review request for atlas, Ashutosh Mestry, Madhan Neethiraj, Nixon Rodrigues, 
and Sarath Subramanian.


Bugs: ATLAS-4005
    https://issues.apache.org/jira/browse/ATLAS-4005


Repository: atlas


Description
-------

- The exception mentioned in the issue comes because the generated gremlin 
query uses it.value() to get the values for an attribute of a vertex, If the 
value isn't present, then it throws the mentioned exception
- In the fix provided, a check is added in the generated gremlin script, where 
property.isPresent(), is checked before getting any value
- In ATLAS-2354, a similar issue was fixed, but because of that change there 
are no results fetched for the scenario mentioned in ATLAS-4005. 
- As part of fix for ATLAS-2354, whatever columns are present in select clause, 
those columns were implicitly added to the where part of query, because this no 
entities are selected
- So this review request reverts that change so that selected values are shown 
for entities matching the where clause
- Also, after reverting the change one DSL Query test case was failing because 
qualifiedName was null for columns which don't exist. So added a check in 
GremilinQueryComposer.process() method to fix that testcase failure


Diffs
-----

  repository/src/main/java/org/apache/atlas/query/GremlinClause.java 55ccabd23 
  repository/src/main/java/org/apache/atlas/query/GremlinQueryComposer.java 
801e89806 
  repository/src/main/java/org/apache/atlas/query/SelectClauseComposer.java 
fc7414802 
  repository/src/test/java/org/apache/atlas/query/DSLQueriesTest.java 5ace37944 


Diff: https://reviews.apache.org/r/72987/diff/1/


Testing
-------

- All the testcases in DSLQueriesTest are passing
- Tested with different queries from UI, like 
"from hdfs_path where name="testPath" select name"
"from hdfs_path where name="testPath" select name, owner"
"from hdfs_path where name="testPath" select name, owner, description"
all give expected results with any exceptions
- Tried the above queries different scenarios
  with all entites having the selected attributes set 
  with some entities having the selected attribute set
  with all entities having owner value as null
all scenarios worked as expected


Thanks,

Jayendra Parab

Reply via email to