You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@atlas.apache.org by Jayendra Parab <ja...@gmail.com> on 2020/10/23 11:50:00 UTC

Review Request 72987: ATLAS-4005 DSL search gives error if select clause contains attributes with null values

-----------------------------------------------------------
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


Re: Review Request 72987: ATLAS-4005 DSL search gives error if select clause contains attributes with null values

Posted by Madhan Neethiraj <ma...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/72987/#review222120
-----------------------------------------------------------


Fix it, then Ship it!





repository/src/main/java/org/apache/atlas/query/GremlinQueryComposer.java
Lines 394 (patched)
<https://reviews.apache.org/r/72987/#comment311186>

    nit: add spaces around operator. "+" => " + "



repository/src/main/java/org/apache/atlas/query/SelectClauseComposer.java
Line 90 (original), 90 (patched)
<https://reviews.apache.org/r/72987/#comment311187>

    nit: add a space after a comma


- Madhan Neethiraj


On Oct. 23, 2020, 11:49 a.m., Jayendra Parab wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/72987/
> -----------------------------------------------------------
> 
> (Updated Oct. 23, 2020, 11:49 a.m.)
> 
> 
> 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
> 
>


Re: Review Request 72987: ATLAS-4005 DSL search gives error if select clause contains attributes with null values

Posted by Nixon Rodrigues <ni...@freestoneinfotech.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/72987/#review222124
-----------------------------------------------------------


Ship it!




Ship It!

- Nixon Rodrigues


On Oct. 23, 2020, 5:43 p.m., Jayendra Parab wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/72987/
> -----------------------------------------------------------
> 
> (Updated Oct. 23, 2020, 5:43 p.m.)
> 
> 
> 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 
>   repository/src/test/java/org/apache/atlas/query/GremlinQueryComposerTest.java 959aa1149 
> 
> 
> Diff: https://reviews.apache.org/r/72987/diff/2/
> 
> 
> 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
> 
>


Re: Review Request 72987: ATLAS-4005 DSL search gives error if select clause contains attributes with null values

Posted by Jayendra Parab <ja...@gmail.com>.

> On Oct. 23, 2020, 5:44 p.m., Ashutosh Mestry wrote:
> > Can you please add per-commit build details.

The build which passed https://ci-builds.apache.org/job/Atlas/job/PreCommit-ATLAS-Build-Test/132/console
The build which failed https://ci-builds.apache.org/job/Atlas/job/PreCommit-ATLAS-Build-Test/131/console


- Jayendra


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


On Oct. 23, 2020, 5:43 p.m., Jayendra Parab wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/72987/
> -----------------------------------------------------------
> 
> (Updated Oct. 23, 2020, 5:43 p.m.)
> 
> 
> 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 
>   repository/src/test/java/org/apache/atlas/query/GremlinQueryComposerTest.java 959aa1149 
> 
> 
> Diff: https://reviews.apache.org/r/72987/diff/2/
> 
> 
> 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
> 
>


Re: Review Request 72987: ATLAS-4005 DSL search gives error if select clause contains attributes with null values

Posted by Ashutosh Mestry via Review Board <no...@reviews.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/72987/#review222121
-----------------------------------------------------------


Ship it!




Can you please add per-commit build details.

- Ashutosh Mestry


On Oct. 23, 2020, 5:43 p.m., Jayendra Parab wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/72987/
> -----------------------------------------------------------
> 
> (Updated Oct. 23, 2020, 5:43 p.m.)
> 
> 
> 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 
>   repository/src/test/java/org/apache/atlas/query/GremlinQueryComposerTest.java 959aa1149 
> 
> 
> Diff: https://reviews.apache.org/r/72987/diff/2/
> 
> 
> 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
> 
>


Re: Review Request 72987: ATLAS-4005 DSL search gives error if select clause contains attributes with null values

Posted by Jayendra Parab <ja...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/72987/
-----------------------------------------------------------

(Updated Oct. 23, 2020, 5:43 p.m.)


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


Changes
-------

- Addressed review comments
- Fixed testcases from GremlineQueryComposerTest which failed in precommit. Added isPresent check in the expected generated query value.


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 (updated)
-----

  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 
  repository/src/test/java/org/apache/atlas/query/GremlinQueryComposerTest.java 959aa1149 


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

Changes: https://reviews.apache.org/r/72987/diff/1-2/


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