Re: Review Request 62679: ATLAS-2184: IS_NULL and NOT_NULL operator support

2017-09-29 Thread Apoorv Naik

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

(Updated Sept. 30, 2017, 1:19 a.m.)


Review request for atlas and Madhan Neethiraj.


Changes
---

1. Added null checks for handling null attrVal in POST request
2. Added missing constructs for case when complete gremlin query is used to 
search


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


Repository: atlas


Description
---

Search parameters in basic search now include is_null, not_null operators which 
can prove useful in scenarios where user is interested in checking the 
presence/absence of certain entity attributes


Diffs (updated)
-

  intg/src/main/java/org/apache/atlas/model/discovery/SearchParameters.java 
a7a71b78 
  repository/src/main/java/org/apache/atlas/discovery/SearchProcessor.java 
b380e1e4 
  
repository/src/main/java/org/apache/atlas/util/AtlasGremlin2QueryProvider.java 
33f9b7ab 
  repository/src/main/java/org/apache/atlas/util/AtlasGremlinQueryProvider.java 
a6025293 
  repository/src/main/java/org/apache/atlas/util/SearchPredicateUtil.java 
18d77ee7 


Diff: https://reviews.apache.org/r/62679/diff/6/

Changes: https://reviews.apache.org/r/62679/diff/5-6/


Testing
---

Tested using various combinations of attributes and IS_NULL/NOT_NULL operator 
via REST client/ curl


Thanks,

Apoorv Naik



Re: Review Request 62679: ATLAS-2184: IS_NULL and NOT_NULL operator support

2017-09-29 Thread Apoorv Naik

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

(Updated Sept. 29, 2017, 11:20 p.m.)


Review request for atlas and Madhan Neethiraj.


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


Repository: atlas


Description
---

Search parameters in basic search now include is_null, not_null operators which 
can prove useful in scenarios where user is interested in checking the 
presence/absence of certain entity attributes


Diffs (updated)
-

  intg/src/main/java/org/apache/atlas/model/discovery/SearchParameters.java 
a7a71b78 
  repository/src/main/java/org/apache/atlas/discovery/SearchProcessor.java 
b380e1e4 
  repository/src/main/java/org/apache/atlas/util/SearchPredicateUtil.java 
18d77ee7 


Diff: https://reviews.apache.org/r/62679/diff/5/

Changes: https://reviews.apache.org/r/62679/diff/4-5/


Testing
---

Tested using various combinations of attributes and IS_NULL/NOT_NULL operator 
via REST client/ curl


Thanks,

Apoorv Naik



Re: Review Request 62679: ATLAS-2184: IS_NULL and NOT_NULL operator support

2017-09-29 Thread Apoorv Naik


> On Sept. 29, 2017, 10:33 p.m., Sarath Subramanian wrote:
> > intg/src/main/java/org/apache/atlas/model/discovery/SearchParameters.java
> > Line 349 (original), 349 (patched)
> > 
> >
> > BEGINS_WITH is specified in both line 348 and 349 -> should it be 
> > ENDS_WITH?

Good catch Sarath.


- Apoorv


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


On Sept. 29, 2017, 4:49 p.m., Apoorv Naik wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/62679/
> ---
> 
> (Updated Sept. 29, 2017, 4:49 p.m.)
> 
> 
> Review request for atlas and Madhan Neethiraj.
> 
> 
> Bugs: ATLAS-2184
> https://issues.apache.org/jira/browse/ATLAS-2184
> 
> 
> Repository: atlas
> 
> 
> Description
> ---
> 
> Search parameters in basic search now include is_null, not_null operators 
> which can prove useful in scenarios where user is interested in checking the 
> presence/absence of certain entity attributes
> 
> 
> Diffs
> -
> 
>   intg/src/main/java/org/apache/atlas/model/discovery/SearchParameters.java 
> a7a71b78 
>   repository/src/main/java/org/apache/atlas/discovery/SearchProcessor.java 
> b380e1e4 
>   repository/src/main/java/org/apache/atlas/util/SearchPredicateUtil.java 
> 18d77ee7 
> 
> 
> Diff: https://reviews.apache.org/r/62679/diff/4/
> 
> 
> Testing
> ---
> 
> Tested using various combinations of attributes and IS_NULL/NOT_NULL operator 
> via REST client/ curl
> 
> 
> Thanks,
> 
> Apoorv Naik
> 
>



Re: Review Request 62679: ATLAS-2184: IS_NULL and NOT_NULL operator support

2017-09-29 Thread Sarath Subramanian

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


Fix it, then Ship it!





intg/src/main/java/org/apache/atlas/model/discovery/SearchParameters.java
Line 349 (original), 349 (patched)


BEGINS_WITH is specified in both line 348 and 349 -> should it be ENDS_WITH?


- Sarath Subramanian


On Sept. 29, 2017, 9:49 a.m., Apoorv Naik wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/62679/
> ---
> 
> (Updated Sept. 29, 2017, 9:49 a.m.)
> 
> 
> Review request for atlas and Madhan Neethiraj.
> 
> 
> Bugs: ATLAS-2184
> https://issues.apache.org/jira/browse/ATLAS-2184
> 
> 
> Repository: atlas
> 
> 
> Description
> ---
> 
> Search parameters in basic search now include is_null, not_null operators 
> which can prove useful in scenarios where user is interested in checking the 
> presence/absence of certain entity attributes
> 
> 
> Diffs
> -
> 
>   intg/src/main/java/org/apache/atlas/model/discovery/SearchParameters.java 
> a7a71b78 
>   repository/src/main/java/org/apache/atlas/discovery/SearchProcessor.java 
> b380e1e4 
>   repository/src/main/java/org/apache/atlas/util/SearchPredicateUtil.java 
> 18d77ee7 
> 
> 
> Diff: https://reviews.apache.org/r/62679/diff/4/
> 
> 
> Testing
> ---
> 
> Tested using various combinations of attributes and IS_NULL/NOT_NULL operator 
> via REST client/ curl
> 
> 
> Thanks,
> 
> Apoorv Naik
> 
>



Re: Review Request 62679: ATLAS-2184: IS_NULL and NOT_NULL operator support

2017-09-29 Thread Apoorv Naik

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

(Updated Sept. 29, 2017, 4:49 p.m.)


Review request for atlas and Madhan Neethiraj.


Changes
---

Added an optional parameter in the VertexAttributePredicate to allow 
compareValue to be called when attrVal is null. By default it is "false", only 
for isNull/notNull the comparison will be allowed against null vertex attribute 
values.


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


Repository: atlas


Description
---

Search parameters in basic search now include is_null, not_null operators which 
can prove useful in scenarios where user is interested in checking the 
presence/absence of certain entity attributes


Diffs (updated)
-

  intg/src/main/java/org/apache/atlas/model/discovery/SearchParameters.java 
a7a71b78 
  repository/src/main/java/org/apache/atlas/discovery/SearchProcessor.java 
b380e1e4 
  repository/src/main/java/org/apache/atlas/util/SearchPredicateUtil.java 
18d77ee7 


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

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


Testing
---

Tested using various combinations of attributes and IS_NULL/NOT_NULL operator 
via REST client/ curl


Thanks,

Apoorv Naik



Re: Review Request 62679: ATLAS-2184: IS_NULL and NOT_NULL operator support

2017-09-29 Thread Apoorv Naik

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

(Updated Sept. 29, 2017, 3:49 p.m.)


Review request for atlas and Madhan Neethiraj.


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


Repository: atlas


Description
---

Search parameters in basic search now include is_null, not_null operators which 
can prove useful in scenarios where user is interested in checking the 
presence/absence of certain entity attributes


Diffs (updated)
-

  intg/src/main/java/org/apache/atlas/model/discovery/SearchParameters.java 
a7a71b78 
  repository/src/main/java/org/apache/atlas/discovery/SearchProcessor.java 
b380e1e4 
  repository/src/main/java/org/apache/atlas/util/SearchPredicateUtil.java 
18d77ee7 


Diff: https://reviews.apache.org/r/62679/diff/3/

Changes: https://reviews.apache.org/r/62679/diff/2-3/


Testing
---

Tested using various combinations of attributes and IS_NULL/NOT_NULL operator 
via REST client/ curl


Thanks,

Apoorv Naik



Re: Review Request 62679: ATLAS-2184: IS_NULL and NOT_NULL operator support

2017-09-29 Thread Apoorv Naik

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




repository/src/main/java/org/apache/atlas/util/SearchPredicateUtil.java
Lines 558 (patched)


I think the names are really confusing here. Will update the patch with 
suggested changes and some variable name changes.


- Apoorv Naik


On Sept. 29, 2017, 2:05 p.m., Apoorv Naik wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/62679/
> ---
> 
> (Updated Sept. 29, 2017, 2:05 p.m.)
> 
> 
> Review request for atlas and Madhan Neethiraj.
> 
> 
> Bugs: ATLAS-2184
> https://issues.apache.org/jira/browse/ATLAS-2184
> 
> 
> Repository: atlas
> 
> 
> Description
> ---
> 
> Search parameters in basic search now include is_null, not_null operators 
> which can prove useful in scenarios where user is interested in checking the 
> presence/absence of certain entity attributes
> 
> 
> Diffs
> -
> 
>   intg/src/main/java/org/apache/atlas/model/discovery/SearchParameters.java 
> a7a71b78 
>   repository/src/main/java/org/apache/atlas/discovery/SearchProcessor.java 
> b380e1e4 
>   repository/src/main/java/org/apache/atlas/util/SearchPredicateUtil.java 
> 18d77ee7 
> 
> 
> Diff: https://reviews.apache.org/r/62679/diff/2/
> 
> 
> Testing
> ---
> 
> Tested using various combinations of attributes and IS_NULL/NOT_NULL operator 
> via REST client/ curl
> 
> 
> Thanks,
> 
> Apoorv Naik
> 
>



Re: Review Request 62679: ATLAS-2184: IS_NULL and NOT_NULL operator support

2017-09-29 Thread Madhan Neethiraj

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




repository/src/main/java/org/apache/atlas/util/SearchPredicateUtil.java
Lines 563 (patched)


For IS_NULL and IS_NOT_NULL operators, the given 'attrVal' should be 
ignored - as they are unary operators. The result should be based on the value 
read from vertex attribute - like:

if (attrName == null || attrClass == null) {
ret = ALWAYS_FALSE;
} else {
ret = new VertexAttributePredicate(attrName, attrClass, true) {
@Override
protected boolean compareValue(final Object value) {
return value == null;
}
};
}


- Madhan Neethiraj


On Sept. 29, 2017, 2:05 p.m., Apoorv Naik wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/62679/
> ---
> 
> (Updated Sept. 29, 2017, 2:05 p.m.)
> 
> 
> Review request for atlas and Madhan Neethiraj.
> 
> 
> Bugs: ATLAS-2184
> https://issues.apache.org/jira/browse/ATLAS-2184
> 
> 
> Repository: atlas
> 
> 
> Description
> ---
> 
> Search parameters in basic search now include is_null, not_null operators 
> which can prove useful in scenarios where user is interested in checking the 
> presence/absence of certain entity attributes
> 
> 
> Diffs
> -
> 
>   intg/src/main/java/org/apache/atlas/model/discovery/SearchParameters.java 
> a7a71b78 
>   repository/src/main/java/org/apache/atlas/discovery/SearchProcessor.java 
> b380e1e4 
>   repository/src/main/java/org/apache/atlas/util/SearchPredicateUtil.java 
> 18d77ee7 
> 
> 
> Diff: https://reviews.apache.org/r/62679/diff/2/
> 
> 
> Testing
> ---
> 
> Tested using various combinations of attributes and IS_NULL/NOT_NULL operator 
> via REST client/ curl
> 
> 
> Thanks,
> 
> Apoorv Naik
> 
>



Re: Review Request 62679: ATLAS-2184: IS_NULL and NOT_NULL operator support

2017-09-29 Thread Apoorv Naik

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

(Updated Sept. 29, 2017, 2:05 p.m.)


Review request for atlas and Madhan Neethiraj.


Changes
---

Added explicit null checks on the attrVal as over-simplification led to 
incorrect logic.


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


Repository: atlas


Description
---

Search parameters in basic search now include is_null, not_null operators which 
can prove useful in scenarios where user is interested in checking the 
presence/absence of certain entity attributes


Diffs (updated)
-

  intg/src/main/java/org/apache/atlas/model/discovery/SearchParameters.java 
a7a71b78 
  repository/src/main/java/org/apache/atlas/discovery/SearchProcessor.java 
b380e1e4 
  repository/src/main/java/org/apache/atlas/util/SearchPredicateUtil.java 
18d77ee7 


Diff: https://reviews.apache.org/r/62679/diff/2/

Changes: https://reviews.apache.org/r/62679/diff/1-2/


Testing
---

Tested using various combinations of attributes and IS_NULL/NOT_NULL operator 
via REST client/ curl


Thanks,

Apoorv Naik



Re: Review Request 62679: ATLAS-2184: IS_NULL and NOT_NULL operator support

2017-09-28 Thread Madhan Neethiraj

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




repository/src/main/java/org/apache/atlas/util/SearchPredicateUtil.java
Lines 564 (patched)


Why ALWAYS_TRUE here? Shouldn't the result be true only when the attribute 
value is NULL?



repository/src/main/java/org/apache/atlas/util/SearchPredicateUtil.java
Lines 591 (patched)


Why ALWAYS_TRUE here? Shouldn't the result be true only when the attribute 
value is NOT NULL?


- Madhan Neethiraj


On Sept. 29, 2017, 1:08 a.m., Apoorv Naik wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/62679/
> ---
> 
> (Updated Sept. 29, 2017, 1:08 a.m.)
> 
> 
> Review request for atlas and Madhan Neethiraj.
> 
> 
> Bugs: ATLAS-2184
> https://issues.apache.org/jira/browse/ATLAS-2184
> 
> 
> Repository: atlas
> 
> 
> Description
> ---
> 
> Search parameters in basic search now include is_null, not_null operators 
> which can prove useful in scenarios where user is interested in checking the 
> presence/absence of certain entity attributes
> 
> 
> Diffs
> -
> 
>   intg/src/main/java/org/apache/atlas/model/discovery/SearchParameters.java 
> a7a71b78 
>   repository/src/main/java/org/apache/atlas/discovery/SearchProcessor.java 
> b380e1e4 
>   repository/src/main/java/org/apache/atlas/util/SearchPredicateUtil.java 
> 18d77ee7 
> 
> 
> Diff: https://reviews.apache.org/r/62679/diff/1/
> 
> 
> Testing
> ---
> 
> Tested using various combinations of attributes and IS_NULL/NOT_NULL operator 
> via REST client/ curl
> 
> 
> Thanks,
> 
> Apoorv Naik
> 
>



Review Request 62679: ATLAS-2184: IS_NULL and NOT_NULL operator support

2017-09-28 Thread Apoorv Naik

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

Review request for atlas and Madhan Neethiraj.


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


Repository: atlas


Description
---

Search parameters in basic search now include is_null, not_null operators which 
can prove useful in scenarios where user is interested in checking the 
presence/absence of certain entity attributes


Diffs
-

  intg/src/main/java/org/apache/atlas/model/discovery/SearchParameters.java 
a7a71b78 
  repository/src/main/java/org/apache/atlas/discovery/SearchProcessor.java 
b380e1e4 
  repository/src/main/java/org/apache/atlas/util/SearchPredicateUtil.java 
18d77ee7 


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


Testing
---

Tested using various combinations of attributes and IS_NULL/NOT_NULL operator 
via REST client/ curl


Thanks,

Apoorv Naik