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

(Updated Dec. 12, 2017, 3:23 a.m.)


Review request for atlas, Apoorv Naik, Madhan Neethiraj, and Sarath Subramanian.


Changes
-------

Updates include:
- Update G4 files. Updates to grammer to handle edge cases, and quoted 
identifiers.
- Updated unit tests.


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


Repository: atlas


Description
-------

**Background**
Atlas' DSL implementation was removed with the removal of the older type system 
implementation, thus creating gap in functionality.

The patch implements Atlas' DSL using Antlr and a new from-scratch 
implementation.

**Approach**
Highlights of the implementation:
- Does not use any of the old scala-based implementation of lexer and parser. 
It uses Antlr library for this purpose.
- Generated Gremlin queries are much simpler than the earlier implementation. 
- Interface with rest of the application has been streamlined.

The Antlr's G4 (_Atlas.G4_) grammer file implements the DSL grammer. Antlr 
code-generates the requisit lexer and parser.

The _DSLVisitor_ class is the concrete visitor implementation for the generated 
syntax tree. 

_QueryProcessor_ maintains sequence of Gremlin clauses that are found during 
the abstract syntax tree traversal. It uses _TypeRegistry_ for creating 
qualified names.

Integration with rest of the application has had little impact.


Diffs (updated)
-----

  3party-licenses/Antlr-LICENSE PRE-CREATION 
  pom.xml 233506c8 
  repository/pom.xml 35b74e32 
  
repository/src/main/java/org/apache/atlas/discovery/EntityDiscoveryService.java 
67aeb308 
  repository/src/main/java/org/apache/atlas/query/DSLVisitor.java PRE-CREATION 
  repository/src/main/java/org/apache/atlas/query/Expressions.java 9e93ce41 
  repository/src/main/java/org/apache/atlas/query/GremlinQuery.java fcb1f483 
  repository/src/main/java/org/apache/atlas/query/GremlinTranslator.java 
5395ddd3 
  repository/src/main/java/org/apache/atlas/query/QueryParser.java 1e5e5ff9 
  repository/src/main/java/org/apache/atlas/query/QueryProcessor.java 04cf0b4d 
  repository/src/main/java/org/apache/atlas/query/SelectExpressionHelper.java 
a8748efa 
  repository/src/main/java/org/apache/atlas/query/antlr4/AtlasDSLLexer.g4 
PRE-CREATION 
  repository/src/main/java/org/apache/atlas/query/antlr4/AtlasDSLLexer.java 
PRE-CREATION 
  repository/src/main/java/org/apache/atlas/query/antlr4/AtlasDSLLexer.tokens 
PRE-CREATION 
  repository/src/main/java/org/apache/atlas/query/antlr4/AtlasDSLParser.g4 
PRE-CREATION 
  repository/src/main/java/org/apache/atlas/query/antlr4/AtlasDSLParser.java 
PRE-CREATION 
  repository/src/main/java/org/apache/atlas/query/antlr4/AtlasDSLParser.tokens 
PRE-CREATION 
  
repository/src/main/java/org/apache/atlas/query/antlr4/AtlasDSLParserBaseVisitor.java
 PRE-CREATION 
  
repository/src/main/java/org/apache/atlas/query/antlr4/AtlasDSLParserVisitor.java
 PRE-CREATION 
  repository/src/test/java/org/apache/atlas/query/BasicTestSetup.java 
PRE-CREATION 
  repository/src/test/java/org/apache/atlas/query/DSLQueriesTest.java 
PRE-CREATION 
  repository/src/test/java/org/apache/atlas/query/QueryProcessorTest.java 
PRE-CREATION 
  
repository/src/test/java/org/apache/atlas/services/EntityDiscoveryServiceTest.java
 PRE-CREATION 
  webapp/src/main/java/org/apache/atlas/examples/QuickStartV2.java a338ae2a 


Diff: https://reviews.apache.org/r/64476/diff/7/

Changes: https://reviews.apache.org/r/64476/diff/6-7/


Testing
-------

**Unit tests**
_QueryProcessorTest_ implements the testing framework for DSL. It has relevant 
code that setup up environment to verify various clauses implemented.

**Functional testing**
- Verified from web UI.
- Verified using '_Saved Search_' feature.

**Additional verification**
Generated Gremlin queries have been verified using JanusGraph shell customized 
for Atlas.


Thanks,

Ashutosh Mestry

Reply via email to