You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@atlas.apache.org by Ashutosh Mestry <am...@hortonworks.com> on 2018/01/12 21:45:50 UTC
Review Request 65133: Advanced Search: DSL: Error Handling
Improvements
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/65133/
-----------------------------------------------------------
Review request for atlas and Apoorv Naik.
Bugs: ATLAS-2360
https://issues.apache.org/jira/browse/ATLAS-2360
Repository: atlas
Description
-------
**Background**
The _GremlinQueryComposer.errorList_ used earlier in the implementation was not getting populated correctly. The errors encountered in the process were not getting displayed.
**Approach**
The _GremlinQueryComposer.errorList_ is now being populated at different point in the parsing process.
_AtlasDSL_ has been updated to process the errors and throw exceptions.
Additional refactoring in _IdentifierHelper_ when processing _qualifiedName_.
**Queries**
The following query displays an error since 'name' is not attribute of _hive_storagedescriptor_:
```
hive_table select sd.name
```
Diffs
-----
intg/src/main/java/org/apache/atlas/AtlasErrorCode.java 0953725c
repository/src/main/java/org/apache/atlas/query/AtlasDSL.java 7817f91a
repository/src/main/java/org/apache/atlas/query/GremlinQueryComposer.java fe2d6d7f
repository/src/main/java/org/apache/atlas/query/IdentifierHelper.java d8221aa0
repository/src/main/java/org/apache/atlas/query/Lookup.java fa75cfbd
repository/src/main/java/org/apache/atlas/query/RegistryBasedLookup.java b78bd2e5
repository/src/test/java/org/apache/atlas/query/DSLQueriesTest.java 5db55dce
repository/src/test/java/org/apache/atlas/query/GremlinQueryComposerTest.java 3fcd3256
Diff: https://reviews.apache.org/r/65133/diff/1/
Testing
-------
**Unit tests**
- New tests added for processing exceptions.
**Functional tests**
- Verified cases where error is displayed.
Thanks,
Ashutosh Mestry
Re: Review Request 65133: Advanced Search: DSL: Error Handling
Improvements
Posted by Madhan Neethiraj <ma...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/65133/#review195392
-----------------------------------------------------------
repository/src/main/java/org/apache/atlas/query/AtlasDSL.java
Lines 53 (patched)
<https://reviews.apache.org/r/65133/#comment274557>
Looks like 'inputQuery' is unused. Please remove.
repository/src/main/java/org/apache/atlas/query/AtlasDSL.java
Lines 138 (patched)
<https://reviews.apache.org/r/65133/#comment274558>
Wouldn't this case the exception from line #131 be unreported? Please review.
- Madhan Neethiraj
On Jan. 13, 2018, 6:30 a.m., Ashutosh Mestry wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/65133/
> -----------------------------------------------------------
>
> (Updated Jan. 13, 2018, 6:30 a.m.)
>
>
> Review request for atlas and Apoorv Naik.
>
>
> Bugs: ATLAS-2360
> https://issues.apache.org/jira/browse/ATLAS-2360
>
>
> Repository: atlas
>
>
> Description
> -------
>
> **Background**
> The _GremlinQueryComposer.errorList_ used earlier in the implementation was not getting populated correctly. The errors encountered in the process were not getting displayed.
>
> **Approach**
> The _GremlinQueryComposer.errorList_ is now being populated at different point in the parsing process.
>
> _AtlasDSL_ has been updated to process the errors and throw exceptions.
>
> Additional refactoring in _IdentifierHelper_ when processing _qualifiedName_.
>
> **Queries**
> The following query displays an error since 'name' is not attribute of _hive_storagedescriptor_:
> ```
> hive_table select sd.name
> ```
>
>
> Diffs
> -----
>
> intg/src/main/java/org/apache/atlas/AtlasErrorCode.java 0953725c
> repository/src/main/java/org/apache/atlas/query/AtlasDSL.java 7817f91a
> repository/src/main/java/org/apache/atlas/query/GremlinQueryComposer.java fe2d6d7f
> repository/src/main/java/org/apache/atlas/query/IdentifierHelper.java d8221aa0
> repository/src/main/java/org/apache/atlas/query/Lookup.java fa75cfbd
> repository/src/main/java/org/apache/atlas/query/RegistryBasedLookup.java b78bd2e5
> repository/src/main/java/org/apache/atlas/query/SelectClauseComposer.java b93e2234
> repository/src/test/java/org/apache/atlas/query/DSLQueriesTest.java 5db55dce
> repository/src/test/java/org/apache/atlas/query/GremlinQueryComposerTest.java 3fcd3256
>
>
> Diff: https://reviews.apache.org/r/65133/diff/5/
>
>
> Testing
> -------
>
> **Unit tests**
> - New tests added for processing exceptions.
>
> **Functional tests**
> - Verified cases where error is displayed.
>
> **Custom Types testing**
> See attached custom _typeDef_ and _entityDef_. Use these CURL calls to update your system with the new definitions:
> ```
> curl -X POST -u admin:admin -H 'Content-Type: application/json' -d @type_def.json "http://localhost:21000/api/atlas/v2/types/typedefs"
> curl -X POST -u admin:admin -H 'Content-Type: application/json' -d @entity_def.json "http://localhost:21000/api/atlas/v2/entity"
> ```
> Now run these queries:
> ```
> test_type where name="test_entity_1" select type_arr_list
> test_type where name="test_entity_1" select type_map
> ```
>
>
> File Attachments
> ----------------
>
> entity_def.json
> https://reviews.apache.org/media/uploaded/files/2018/01/13/be2530fa-18f0-4474-b034-9bc7f2c6dff5__entity_def.json
> type_def.json
> https://reviews.apache.org/media/uploaded/files/2018/01/13/6860b20e-6115-46b1-a265-4010c1012fe7__type_def.json
>
>
> Thanks,
>
> Ashutosh Mestry
>
>
Re: Review Request 65133: Advanced Search: DSL: Error Handling
Improvements
Posted by Ashutosh Mestry <am...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/65133/
-----------------------------------------------------------
(Updated Jan. 13, 2018, 6:30 a.m.)
Review request for atlas and Apoorv Naik.
Changes
-------
Updates include:
- Error message display for null values.
- Fixed handling of custom types with collection that include primitive and non-primitive types.
- Refactoring of _RegistryBasedLookup_.
Bugs: ATLAS-2360
https://issues.apache.org/jira/browse/ATLAS-2360
Repository: atlas
Description
-------
**Background**
The _GremlinQueryComposer.errorList_ used earlier in the implementation was not getting populated correctly. The errors encountered in the process were not getting displayed.
**Approach**
The _GremlinQueryComposer.errorList_ is now being populated at different point in the parsing process.
_AtlasDSL_ has been updated to process the errors and throw exceptions.
Additional refactoring in _IdentifierHelper_ when processing _qualifiedName_.
**Queries**
The following query displays an error since 'name' is not attribute of _hive_storagedescriptor_:
```
hive_table select sd.name
```
Diffs (updated)
-----
intg/src/main/java/org/apache/atlas/AtlasErrorCode.java 0953725c
repository/src/main/java/org/apache/atlas/query/AtlasDSL.java 7817f91a
repository/src/main/java/org/apache/atlas/query/GremlinQueryComposer.java fe2d6d7f
repository/src/main/java/org/apache/atlas/query/IdentifierHelper.java d8221aa0
repository/src/main/java/org/apache/atlas/query/Lookup.java fa75cfbd
repository/src/main/java/org/apache/atlas/query/RegistryBasedLookup.java b78bd2e5
repository/src/main/java/org/apache/atlas/query/SelectClauseComposer.java b93e2234
repository/src/test/java/org/apache/atlas/query/DSLQueriesTest.java 5db55dce
repository/src/test/java/org/apache/atlas/query/GremlinQueryComposerTest.java 3fcd3256
Diff: https://reviews.apache.org/r/65133/diff/5/
Changes: https://reviews.apache.org/r/65133/diff/4-5/
Testing (updated)
-------
**Unit tests**
- New tests added for processing exceptions.
**Functional tests**
- Verified cases where error is displayed.
**Custom Types testing**
See attached custom _typeDef_ and _entityDef_. Use these CURL calls to update your system with the new definitions:
```
curl -X POST -u admin:admin -H 'Content-Type: application/json' -d @type_def.json "http://localhost:21000/api/atlas/v2/types/typedefs"
curl -X POST -u admin:admin -H 'Content-Type: application/json' -d @entity_def.json "http://localhost:21000/api/atlas/v2/entity"
```
Now run these queries:
```
test_type where name="test_entity_1" select type_arr_list
test_type where name="test_entity_1" select type_map
```
File Attachments (updated)
----------------
entity_def.json
https://reviews.apache.org/media/uploaded/files/2018/01/13/be2530fa-18f0-4474-b034-9bc7f2c6dff5__entity_def.json
type_def.json
https://reviews.apache.org/media/uploaded/files/2018/01/13/6860b20e-6115-46b1-a265-4010c1012fe7__type_def.json
Thanks,
Ashutosh Mestry
Re: Review Request 65133: Advanced Search: DSL: Error Handling
Improvements
Posted by Madhan Neethiraj <ma...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/65133/#review195357
-----------------------------------------------------------
repository/src/main/java/org/apache/atlas/query/AtlasDSL.java
Lines 53 (patched)
<https://reviews.apache.org/r/65133/#comment274522>
Having 'inputQuery' as static - would this cause trouble when multiple DSL queries execute simultaneously?
- Madhan Neethiraj
On Jan. 12, 2018, 9:45 p.m., Ashutosh Mestry wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/65133/
> -----------------------------------------------------------
>
> (Updated Jan. 12, 2018, 9:45 p.m.)
>
>
> Review request for atlas and Apoorv Naik.
>
>
> Bugs: ATLAS-2360
> https://issues.apache.org/jira/browse/ATLAS-2360
>
>
> Repository: atlas
>
>
> Description
> -------
>
> **Background**
> The _GremlinQueryComposer.errorList_ used earlier in the implementation was not getting populated correctly. The errors encountered in the process were not getting displayed.
>
> **Approach**
> The _GremlinQueryComposer.errorList_ is now being populated at different point in the parsing process.
>
> _AtlasDSL_ has been updated to process the errors and throw exceptions.
>
> Additional refactoring in _IdentifierHelper_ when processing _qualifiedName_.
>
> **Queries**
> The following query displays an error since 'name' is not attribute of _hive_storagedescriptor_:
> ```
> hive_table select sd.name
> ```
>
>
> Diffs
> -----
>
> intg/src/main/java/org/apache/atlas/AtlasErrorCode.java 0953725c
> repository/src/main/java/org/apache/atlas/query/AtlasDSL.java 7817f91a
> repository/src/main/java/org/apache/atlas/query/GremlinQueryComposer.java fe2d6d7f
> repository/src/main/java/org/apache/atlas/query/IdentifierHelper.java d8221aa0
> repository/src/main/java/org/apache/atlas/query/Lookup.java fa75cfbd
> repository/src/main/java/org/apache/atlas/query/RegistryBasedLookup.java b78bd2e5
> repository/src/test/java/org/apache/atlas/query/DSLQueriesTest.java 5db55dce
> repository/src/test/java/org/apache/atlas/query/GremlinQueryComposerTest.java 3fcd3256
>
>
> Diff: https://reviews.apache.org/r/65133/diff/1/
>
>
> Testing
> -------
>
> **Unit tests**
> - New tests added for processing exceptions.
>
> **Functional tests**
> - Verified cases where error is displayed.
>
>
> Thanks,
>
> Ashutosh Mestry
>
>