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

(Updated May 5, 2020, 11:45 a.m.)


Review request for atlas, Bolke de Bruin, Madhan Neethiraj, and Nixon Rodrigues.


Repository: atlas


Description
-------

EntitySearchProcessor fails when doing search by classification and specify 
orderBy attribute. The issue is that for graph query you cannot refer to 
attribute by name but need to provide absolute path to entity attribute e.g. 

 

```

{ "attributes": [ "description", "comment", "popularityScore" ], 
"classification": "customer_NON_PII", "excludeDeletedEntities": "False", 
"limit": "", "offset": 100, "sortBy": "Table.popularityScore", "sortOrder": 
"DESCENDING", "typeName": "hive_table" }
```

this query fails with following exception:

 

```

{"exception":{"message":"Provided key does not exist: 
hive_table.popularityScore","class":"java.lang.IllegalArgumentException","stacktrace":"java.lang.IllegalArgumentException:
 Provided key does not exist: hive_table.popularityScore\n\tat 
com.google.common.base.Preconditions.checkArgument(Preconditions.java:163)\n\tat
 org.janusgraph.graphdb.query.graph.GraphCentricQueryBuilder.
orderBy(GraphCentricQueryBuilder.java:160)

```

 

When specify full reference to attribute e.g. 

 

```

{ "attributes": [ "description", "comment", "popularityScore" ], 
"classification": "customer_NON_PII", "excludeDeletedEntities": "False", 
"limit": "", "offset": 100, "sortBy": "Table.popularityScore", "sortOrder": 
"DESCENDING", "typeName": "hive_table" }
```

it fails on validation stage

 

```

{"exception":{"message":"Attribute Table.popularityScore not found for type 
Table","class":"org.apache.atlas.exception.AtlasBaseException","stacktrace":"org.apache.atlas.exception.AtlasBaseException:
 Attribute Table.popularityScore not found for type Table\n\tat 
org.apache.atlas.discovery.SearchContext.validateAttributes(SearchContext.java:288)

```

Reference to JIRA https://issues.apache.org/jira/browse/ATLAS-3776


Diffs
-----

  
repository/src/main/java/org/apache/atlas/discovery/EntitySearchProcessor.java 
1a7bf6b16 


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


Testing
-------

tested on our dev env.


File Attachments (updated)
----------------

ATLAS-3776-1.patch
  
https://reviews.apache.org/media/uploaded/files/2020/05/05/96de2792-c75b-4440-8368-8791be7b005f__ATLAS-3776-1.patch


Thanks,

Damian Warszawski

Reply via email to