atlas-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ashutosh Mestry <ames...@hortonworks.com>
Subject Re: Review Request 65297: Advanced Search DSL: Support System Attributes within Query
Date Thu, 25 Jan 2018 05:41:19 GMT

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

(Updated Jan. 25, 2018, 5:41 a.m.)


Review request for atlas and Apoorv Naik.


Changes
-------

Updates include:
- Addressed review comments.
- Minor refactoring to unit tests.


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


Repository: atlas


Description
-------

**Background**
Current implementation of DSL query does not support system attributes within the query.

**Analysis**
The _AtlasEntity_ does not recognize system attributes as attributes. There isn't a way to
fetch all the system attributes for a given entity.

During vertex creation, system attributes are added to the vertex. They are part of the vertex,
hence the only way to fetch them is by having a vertex.

Adding vertex to _RegistryBasedLook_ will create additional dependency. It will also force
instantiation of an entity just for doing existence checks.

**Approach & Impact**
_query.RegistryBasedLookup_:
- Modify _hasAttribute_ to recognize system attributes as part of any type. Treat system attributes
as primitive types, modify _isPrimitive_.
- These are the attributes treated as system attributes:
  - __guid
  - __typeName
  - __createTime
  - __updateTime
  - __createdBy
  - __updatedBy

**New Queries Supported**
```
hive_db has __state
hive_db where hive_db has __state
hive_db as d where d.__state = 'ACTIVE'
hive_db select __guid
hive_db where __state = 'ACTIVE' select name, __guid, __state
hive_table where __state = 'DELETED'
```


Diffs (updated)
-----

  repository/src/main/java/org/apache/atlas/query/DSLVisitor.java 9a213a32 
  repository/src/main/java/org/apache/atlas/query/GremlinQueryComposer.java 95ba4617 
  repository/src/main/java/org/apache/atlas/query/RegistryBasedLookup.java eef3463e 
  repository/src/test/java/org/apache/atlas/query/DSLQueriesTest.java c44eea3b 
  repository/src/test/java/org/apache/atlas/query/GremlinQueryComposerTest.java 5b394cb2 


Diff: https://reviews.apache.org/r/65297/diff/4/

Changes: https://reviews.apache.org/r/65297/diff/3-4/


Testing
-------

**Unit tests**
- Updated _GremlinQueryComposerTest_ to include additional tests.
- Updated _DSLQueriesTest_ to include additional tests.

**Funtional tests**
- Executed queries from within web ui.


Thanks,

Ashutosh Mestry


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message