atlas-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Madhan Neethiraj <mad...@apache.org>
Subject Re: Review Request 62491: ATLAS-2151: Surrounding brace fix for multiple filters on same attribute
Date Sat, 23 Sep 2017 01:17:39 GMT

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


Ship it!




Ship It!

- Madhan Neethiraj


On Sept. 23, 2017, 1:11 a.m., Apoorv Naik wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/62491/
> -----------------------------------------------------------
> 
> (Updated Sept. 23, 2017, 1:11 a.m.)
> 
> 
> Review request for atlas, Ashutosh Mestry, Madhan Neethiraj, and Sarath Subramanian.
> 
> 
> Bugs: ATLAS-2151
>     https://issues.apache.org/jira/browse/ATLAS-2151
> 
> 
> Repository: atlas
> 
> 
> Description
> -------
> 
> While fixing the bugs surronding the index query generation, the case where multiple
filters on a single entity attribute are specified was not being handled correctly. This would
cause the index to return wrong results or a smaller dataset. 
> 
> level == 0 check in the constructIndexQuery led to this problem.
> 
> The fix is to encapsulate the entity filters index clauses within braces if there are
more than one attribute filters.
> 
> 
> Diffs
> -----
> 
>   repository/src/main/java/org/apache/atlas/discovery/SearchProcessor.java 64a86b93 
> 
> 
> Diff: https://reviews.apache.org/r/62491/diff/2/
> 
> 
> Testing
> -------
> 
> mvn clean package -Pberkeley-elasticsearch works fine
> 
> Tested the REST call with following search parameters
> 
> ```javascript
> 
> {
> 	"typeName": "hive_table",
> 	"excludeDeletedEntities": true,
> 	"classification" : "",
> 	"query": "",
> 	"limit": 10,
> 	"offset": 0,
> 	"entityFilters": {
> 		"condition": "AND",
> 		"criterion": [
> 			{
> 				"attributeName": "createTime",
> 				"operator": "neq",
> 				"attributeValue": "1491248917103"
> 			},
> 			{
>                 "attributeName": "name",
>                 "operator": "eq",
>                 "attributeValue": "testtable_0"
>             }
> 		]
> 	},
> 	"tagFilters": null,
> 	"attributes": ["createTime"]
> }
> 
> {
> 	"typeName": "hive_table",
> 	"excludeDeletedEntities": true,
> 	"classification" : "",
> 	"query": "",
> 	"limit": 10,
> 	"offset": 0,
> 	"entityFilters": {
> 		"condition": "OR",
> 		"criterion": [
> 			{
> 				"attributeName": "name",
> 				"operator": "eq",
> 				"attributeValue": "testtable_1"
> 			},
> 			{
>                 "attributeName": "name",
>                 "operator": "eq",
>                 "attributeValue": "testtable_0"
>             }
> 		]
> 	},
> 	"tagFilters": null,
> 	"attributes": ["createTime"]
> }
> 
> {
> 	"typeName": "hive_table",
> 	"excludeDeletedEntities": true,
> 	"classification" : "",
> 	"query": "",
> 	"limit": 10,
> 	"offset": 0,
> 	"entityFilters": {
> 	    "attributeName": "createTime",
> 		"operator": "neq",
> 		"attributeValue": "1491248917103"
> 	},	
> 	"tagFilters": null,
> 	"attributes": ["createTime"]
> }
> ```
> 
> Verified from logs that the index query is enclosed within braces for multi-filter attribute
query and not when there's only one attribute (single) filter
> 
> Verified the results from REST calls (as UI doesn't support this use case)
> 
> 
> Thanks,
> 
> Apoorv Naik
> 
>


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