You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@atlas.apache.org by Mandar Ambawane <ma...@freestoneinfotech.com> on 2019/07/25 05:52:02 UTC

Re: Review Request 71160: ATLAS-3347 :- Relationships instance attributes validation for primitive inbuilt type.

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

(Updated July 25, 2019, 5:52 a.m.)


Review request for atlas, Ashutosh Mestry, Madhan Neethiraj, Nixon Rodrigues, and Sarath Subramanian.


Changes
-------

ATLAS-3347 :- Relationships instance attributes validation for primitive inbuilt type.


Summary (updated)
-----------------

ATLAS-3347 :- Relationships instance attributes validation for primitive inbuilt type.


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


Repository: atlas


Description (updated)
-------

This patch handles data type value exceeding and throws proper exception when we create Relationship entity.


Diffs
-----

  intg/src/main/java/org/apache/atlas/type/AtlasBuiltInTypes.java ce14b5b 


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


Testing (updated)
-------

Testing done Lower limit and Upper limit of primitive datatypes.


Thanks,

Mandar Ambawane


Re: Review Request 71160: ATLAS-3347 :- Relationships instance attributes validation for primitive inbuilt type.

Posted by Mandar Ambawane <ma...@freestoneinfotech.com>.

> On July 28, 2019, 8:43 p.m., Madhan Neethiraj wrote:
> > intg/src/main/java/org/apache/atlas/type/AtlasBuiltInTypes.java
> > Lines 408 (patched)
> > <https://reviews.apache.org/r/71160/diff/4/?file=2158029#file2158029line411>
> >
> >     Can 'float' value be outside the range of (-Float.MAX_VALUE .. Float.MAX_VALUE)? If 'num' is of BigInteger or BigDecimal, you should convert to a BigDecimal and perform range check.

When float value is beyond the lower limit, num.floatValue() returns -Infinity. and when float value is beyond the upper limit, num.floatValue() returns +Infinity.
Thats why I think we dont need to use BigDecimal over here.


> On July 28, 2019, 8:43 p.m., Madhan Neethiraj wrote:
> > intg/src/main/java/org/apache/atlas/type/AtlasBuiltInTypes.java
> > Lines 494 (patched)
> > <https://reviews.apache.org/r/71160/diff/4/?file=2158029#file2158029line497>
> >
> >     Can 'double' value be outside the range of (-Double.MAX_VALUE .. Double.MAX_VALUE)? If 'num' is of BigInteger or BigDecimal, you should convert to a BigDecimal and perform range check.

When double value is beyond the lower limit, num.doubleValue() returns -Infinity. and when double value is beyond the upper limit, num.doubleValue() returns +Infinity.
Thats why I think we dont need to use BigDecimal over here.


- Mandar


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


On July 28, 2019, 6:22 p.m., Mandar Ambawane wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/71160/
> -----------------------------------------------------------
> 
> (Updated July 28, 2019, 6:22 p.m.)
> 
> 
> Review request for atlas, Ashutosh Mestry, Madhan Neethiraj, Nixon Rodrigues, and Sarath Subramanian.
> 
> 
> Bugs: ATLAS-3347
>     https://issues.apache.org/jira/browse/ATLAS-3347
> 
> 
> Repository: atlas
> 
> 
> Description
> -------
> 
> This patch handles data type value exceeding and throws proper exception when we create Relationship entity.
> 
> 
> Diffs
> -----
> 
>   intg/src/main/java/org/apache/atlas/type/AtlasBuiltInTypes.java ce14b5b 
> 
> 
> Diff: https://reviews.apache.org/r/71160/diff/4/
> 
> 
> Testing
> -------
> 
> Testing done Lower limit and Upper limit of primitive datatypes.
> 
> Here, I have made changes for lower and upper limit for float and double.
> 
> Also for boolean datatype I have handled scenarios mentioned in jira.
> 
> In case of boolean, we need to compare here actual content of the input string, because Boolean constructor with string as an argument considers everything false other than argument case in-sensitive "true".
> 
> Also here for input as null to the method getNormalizedValue() we cannnot return value true, It will break test-case 
> testBooleanTypeGetNormalizedValue()
> 
> 
> Thanks,
> 
> Mandar Ambawane
> 
>


Re: Review Request 71160: ATLAS-3347 :- Relationships instance attributes validation for primitive inbuilt type.

Posted by Madhan Neethiraj <ma...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/71160/#review216902
-----------------------------------------------------------




intg/src/main/java/org/apache/atlas/type/AtlasBuiltInTypes.java
Lines 408 (patched)
<https://reviews.apache.org/r/71160/#comment304146>

    Can 'float' value be outside the range of (-Float.MAX_VALUE .. Float.MAX_VALUE)? If 'num' is of BigInteger or BigDecimal, you should convert to a BigDecimal and perform range check.



intg/src/main/java/org/apache/atlas/type/AtlasBuiltInTypes.java
Lines 494 (patched)
<https://reviews.apache.org/r/71160/#comment304145>

    Can 'double' value be outside the range of (-Double.MAX_VALUE .. Double.MAX_VALUE)? If 'num' is of BigInteger or BigDecimal, you should convert to a BigDecimal and perform range check.


- Madhan Neethiraj


On July 28, 2019, 6:22 p.m., Mandar Ambawane wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/71160/
> -----------------------------------------------------------
> 
> (Updated July 28, 2019, 6:22 p.m.)
> 
> 
> Review request for atlas, Ashutosh Mestry, Madhan Neethiraj, Nixon Rodrigues, and Sarath Subramanian.
> 
> 
> Bugs: ATLAS-3347
>     https://issues.apache.org/jira/browse/ATLAS-3347
> 
> 
> Repository: atlas
> 
> 
> Description
> -------
> 
> This patch handles data type value exceeding and throws proper exception when we create Relationship entity.
> 
> 
> Diffs
> -----
> 
>   intg/src/main/java/org/apache/atlas/type/AtlasBuiltInTypes.java ce14b5b 
> 
> 
> Diff: https://reviews.apache.org/r/71160/diff/4/
> 
> 
> Testing
> -------
> 
> Testing done Lower limit and Upper limit of primitive datatypes.
> 
> Here, I have made changes for lower and upper limit for float and double.
> 
> Also for boolean datatype I have handled scenarios mentioned in jira.
> 
> In case of boolean, we need to compare here actual content of the input string, because Boolean constructor with string as an argument considers everything false other than argument case in-sensitive "true".
> 
> Also here for input as null to the method getNormalizedValue() we cannnot return value true, It will break test-case 
> testBooleanTypeGetNormalizedValue()
> 
> 
> Thanks,
> 
> Mandar Ambawane
> 
>


Re: Review Request 71160: ATLAS-3347 :- Relationships instance attributes validation for primitive inbuilt type.

Posted by Madhan Neethiraj <ma...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/71160/#review216910
-----------------------------------------------------------




intg/src/main/java/org/apache/atlas/type/AtlasBuiltInTypes.java
Lines 408 (patched)
<https://reviews.apache.org/r/71160/#comment304151>

    Try this:
      Double dLessThanFMin = new Double(-Float.MAX_VALUE - 1);
      Double dMoreThanFMax = new Double(Float.MAX_VALUE + 1);
      float  fLessThanFMin = dLessThanFMin.floatValue();
      float  fMoreThanFMax = dMoreThanFMax.floatValue();
    
      System.out.println("dLessThanFMin=" + dLessThanFMin);
      System.out.println("dMoreThanFMax=" + dMoreThanFMax);
      System.out.println("fLessThanFMin=" + fLessThanFMin); // -Infinity? - since "1" less than -Float.MAX_VALUE
      System.out.println("fMoreThanFMax=" + fMoreThanFMax); // +Infinity? - since "1" more than Float.MAX_VALUE


- Madhan Neethiraj


On July 28, 2019, 6:22 p.m., Mandar Ambawane wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/71160/
> -----------------------------------------------------------
> 
> (Updated July 28, 2019, 6:22 p.m.)
> 
> 
> Review request for atlas, Ashutosh Mestry, Madhan Neethiraj, Nixon Rodrigues, and Sarath Subramanian.
> 
> 
> Bugs: ATLAS-3347
>     https://issues.apache.org/jira/browse/ATLAS-3347
> 
> 
> Repository: atlas
> 
> 
> Description
> -------
> 
> This patch handles data type value exceeding and throws proper exception when we create Relationship entity.
> 
> 
> Diffs
> -----
> 
>   intg/src/main/java/org/apache/atlas/type/AtlasBuiltInTypes.java ce14b5b 
> 
> 
> Diff: https://reviews.apache.org/r/71160/diff/4/
> 
> 
> Testing
> -------
> 
> Testing done Lower limit and Upper limit of primitive datatypes.
> 
> Here, I have made changes for lower and upper limit for float and double.
> 
> Also for boolean datatype I have handled scenarios mentioned in jira.
> 
> In case of boolean, we need to compare here actual content of the input string, because Boolean constructor with string as an argument considers everything false other than argument case in-sensitive "true".
> 
> Also here for input as null to the method getNormalizedValue() we cannnot return value true, It will break test-case 
> testBooleanTypeGetNormalizedValue()
> 
> 
> Thanks,
> 
> Mandar Ambawane
> 
>


Re: Review Request 71160: ATLAS-3347 :- Relationships instance attributes validation for primitive inbuilt type.

Posted by Nixon Rodrigues <ni...@freestoneinfotech.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/71160/#review216906
-----------------------------------------------------------




intg/src/main/java/org/apache/atlas/type/AtlasBuiltInTypes.java
Lines 75 (patched)
<https://reviews.apache.org/r/71160/#comment304149>

    Is there any need to type check for number here ?


- Nixon Rodrigues


On July 28, 2019, 6:22 p.m., Mandar Ambawane wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/71160/
> -----------------------------------------------------------
> 
> (Updated July 28, 2019, 6:22 p.m.)
> 
> 
> Review request for atlas, Ashutosh Mestry, Madhan Neethiraj, Nixon Rodrigues, and Sarath Subramanian.
> 
> 
> Bugs: ATLAS-3347
>     https://issues.apache.org/jira/browse/ATLAS-3347
> 
> 
> Repository: atlas
> 
> 
> Description
> -------
> 
> This patch handles data type value exceeding and throws proper exception when we create Relationship entity.
> 
> 
> Diffs
> -----
> 
>   intg/src/main/java/org/apache/atlas/type/AtlasBuiltInTypes.java ce14b5b 
> 
> 
> Diff: https://reviews.apache.org/r/71160/diff/4/
> 
> 
> Testing
> -------
> 
> Testing done Lower limit and Upper limit of primitive datatypes.
> 
> Here, I have made changes for lower and upper limit for float and double.
> 
> Also for boolean datatype I have handled scenarios mentioned in jira.
> 
> In case of boolean, we need to compare here actual content of the input string, because Boolean constructor with string as an argument considers everything false other than argument case in-sensitive "true".
> 
> Also here for input as null to the method getNormalizedValue() we cannnot return value true, It will break test-case 
> testBooleanTypeGetNormalizedValue()
> 
> 
> Thanks,
> 
> Mandar Ambawane
> 
>


Re: Review Request 71160: ATLAS-3347 :- Relationships instance attributes validation for primitive inbuilt type.

Posted by Madhan Neethiraj <ma...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/71160/#review217005
-----------------------------------------------------------


Ship it!




Ship It!

- Madhan Neethiraj


On July 31, 2019, 12:36 p.m., Mandar Ambawane wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/71160/
> -----------------------------------------------------------
> 
> (Updated July 31, 2019, 12:36 p.m.)
> 
> 
> Review request for atlas, Ashutosh Mestry, Madhan Neethiraj, Nixon Rodrigues, and Sarath Subramanian.
> 
> 
> Bugs: ATLAS-3347
>     https://issues.apache.org/jira/browse/ATLAS-3347
> 
> 
> Repository: atlas
> 
> 
> Description
> -------
> 
> This patch handles data type value exceeding and throws proper exception when we create Relationship entity.
> 
> 
> Diffs
> -----
> 
>   intg/src/main/java/org/apache/atlas/type/AtlasBuiltInTypes.java ce14b5b 
>   intg/src/test/java/org/apache/atlas/type/TestAtlasBooleanType.java ec5f75a 
>   intg/src/test/java/org/apache/atlas/type/TestAtlasByteType.java a7ada38 
>   intg/src/test/java/org/apache/atlas/type/TestAtlasDoubleType.java b3cbe72 
>   intg/src/test/java/org/apache/atlas/type/TestAtlasFloatType.java 64fc3e3 
>   intg/src/test/java/org/apache/atlas/type/TestAtlasIntType.java c2b5eb4 
>   intg/src/test/java/org/apache/atlas/type/TestAtlasLongType.java 7eefcc2 
>   intg/src/test/java/org/apache/atlas/type/TestAtlasShortType.java 2b15ba0 
> 
> 
> Diff: https://reviews.apache.org/r/71160/diff/6/
> 
> 
> Testing
> -------
> 
> Testing done Lower limit and Upper limit of primitive datatypes.
> 
> Here, I have made changes for lower and upper limit for float and double.
> 
> Also for boolean datatype I have handled scenarios mentioned in jira.
> 
> In case of boolean, we need to compare here actual content of the input string, because Boolean constructor with string as an argument considers everything false other than argument case in-sensitive "true".
> 
> Also here for input as null to the method getNormalizedValue() we cannnot return value true, It will break test-case 
> testBooleanTypeGetNormalizedValue()
> 
> 
> Thanks,
> 
> Mandar Ambawane
> 
>


Re: Review Request 71160: ATLAS-3347 :- Relationships instance attributes validation for primitive inbuilt type.

Posted by Mandar Ambawane <ma...@freestoneinfotech.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/71160/
-----------------------------------------------------------

(Updated July 31, 2019, 12:36 p.m.)


Review request for atlas, Ashutosh Mestry, Madhan Neethiraj, Nixon Rodrigues, and Sarath Subramanian.


Changes
-------

This patch addresses review comments from Madhan. Also added test cases to validate boundary cases for primitive types, with their MIN/MAX values.

Precommit build started:
https://builds.apache.org/job/PreCommit-ATLAS-Build-Test/1321/console


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


Repository: atlas


Description
-------

This patch handles data type value exceeding and throws proper exception when we create Relationship entity.


Diffs (updated)
-----

  intg/src/main/java/org/apache/atlas/type/AtlasBuiltInTypes.java ce14b5b 
  intg/src/test/java/org/apache/atlas/type/TestAtlasBooleanType.java ec5f75a 
  intg/src/test/java/org/apache/atlas/type/TestAtlasByteType.java a7ada38 
  intg/src/test/java/org/apache/atlas/type/TestAtlasDoubleType.java b3cbe72 
  intg/src/test/java/org/apache/atlas/type/TestAtlasFloatType.java 64fc3e3 
  intg/src/test/java/org/apache/atlas/type/TestAtlasIntType.java c2b5eb4 
  intg/src/test/java/org/apache/atlas/type/TestAtlasLongType.java 7eefcc2 
  intg/src/test/java/org/apache/atlas/type/TestAtlasShortType.java 2b15ba0 


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

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


Testing
-------

Testing done Lower limit and Upper limit of primitive datatypes.

Here, I have made changes for lower and upper limit for float and double.

Also for boolean datatype I have handled scenarios mentioned in jira.

In case of boolean, we need to compare here actual content of the input string, because Boolean constructor with string as an argument considers everything false other than argument case in-sensitive "true".

Also here for input as null to the method getNormalizedValue() we cannnot return value true, It will break test-case 
testBooleanTypeGetNormalizedValue()


Thanks,

Mandar Ambawane


Re: Review Request 71160: ATLAS-3347 :- Relationships instance attributes validation for primitive inbuilt type.

Posted by Mandar Ambawane <ma...@freestoneinfotech.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/71160/
-----------------------------------------------------------

(Updated July 28, 2019, 6:22 p.m.)


Review request for atlas, Ashutosh Mestry, Madhan Neethiraj, Nixon Rodrigues, and Sarath Subramanian.


Changes
-------

Addressed review comments and handled test-cases for boolean datatype.


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


Repository: atlas


Description
-------

This patch handles data type value exceeding and throws proper exception when we create Relationship entity.


Diffs (updated)
-----

  intg/src/main/java/org/apache/atlas/type/AtlasBuiltInTypes.java ce14b5b 


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

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


Testing (updated)
-------

Testing done Lower limit and Upper limit of primitive datatypes.

Here, I have made changes for lower and upper limit for float and double.

Also for boolean datatype I have handled scenarios mentioned in jira.

In case of boolean, we need to compare here actual content of the input string, because Boolean constructor with string as an argument considers everything false other than argument case in-sensitive "true".

Also here for input as null to the method getNormalizedValue() we cannnot return value true, It will break test-case 
testBooleanTypeGetNormalizedValue()


Thanks,

Mandar Ambawane


Re: Review Request 71160: ATLAS-3347 :- Relationships instance attributes validation for primitive inbuilt type.

Posted by Mandar Ambawane <ma...@freestoneinfotech.com>.

> On July 27, 2019, 8:43 a.m., Madhan Neethiraj wrote:
> > intg/src/main/java/org/apache/atlas/type/AtlasBuiltInTypes.java
> > Lines 63 (patched)
> > <https://reviews.apache.org/r/71160/diff/3/?file=2157980#file2157980line63>
> >
> >     Given getNormalizedValue() returns null only when obj is null, it will be efficient to replace this method body to return true - just as the earlier implementation.

input as null to the method getNormalizedValue() we cannnot return value true, It will break test-case 
testBooleanTypeGetNormalizedValue()


- Mandar


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


On July 28, 2019, 6:22 p.m., Mandar Ambawane wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/71160/
> -----------------------------------------------------------
> 
> (Updated July 28, 2019, 6:22 p.m.)
> 
> 
> Review request for atlas, Ashutosh Mestry, Madhan Neethiraj, Nixon Rodrigues, and Sarath Subramanian.
> 
> 
> Bugs: ATLAS-3347
>     https://issues.apache.org/jira/browse/ATLAS-3347
> 
> 
> Repository: atlas
> 
> 
> Description
> -------
> 
> This patch handles data type value exceeding and throws proper exception when we create Relationship entity.
> 
> 
> Diffs
> -----
> 
>   intg/src/main/java/org/apache/atlas/type/AtlasBuiltInTypes.java ce14b5b 
> 
> 
> Diff: https://reviews.apache.org/r/71160/diff/4/
> 
> 
> Testing
> -------
> 
> Testing done Lower limit and Upper limit of primitive datatypes.
> 
> Here, I have made changes for lower and upper limit for float and double.
> 
> Also for boolean datatype I have handled scenarios mentioned in jira.
> 
> In case of boolean, we need to compare here actual content of the input string, because Boolean constructor with string as an argument considers everything false other than argument case in-sensitive "true".
> 
> Also here for input as null to the method getNormalizedValue() we cannnot return value true, It will break test-case 
> testBooleanTypeGetNormalizedValue()
> 
> 
> Thanks,
> 
> Mandar Ambawane
> 
>


Re: Review Request 71160: ATLAS-3347 :- Relationships instance attributes validation for primitive inbuilt type.

Posted by Madhan Neethiraj <ma...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/71160/#review216892
-----------------------------------------------------------




intg/src/main/java/org/apache/atlas/type/AtlasBuiltInTypes.java
Lines 63 (patched)
<https://reviews.apache.org/r/71160/#comment304136>

    Given getNormalizedValue() returns null only when obj is null, it will be efficient to replace this method body to return true - just as the earlier implementation.



intg/src/main/java/org/apache/atlas/type/AtlasBuiltInTypes.java
Lines 405 (patched)
<https://reviews.apache.org/r/71160/#comment304142>

    Math.abs() usage here doesn't look right. Please replace use of "Float.MIN_VALUE" with "-Float.MAX_VALUE".
    
    From: https://docs.oracle.com/javase/8/docs/api/java/lang/Float.html
      MIN_VALUE A constant holding the smallest positive nonzero value of type float, 2-149.



intg/src/main/java/org/apache/atlas/type/AtlasBuiltInTypes.java
Lines 491 (patched)
<https://reviews.apache.org/r/71160/#comment304143>

    Math.abs() usage here doesn't look right. Please replace use of "Double.MIN_VALUE" with "-Double.MAX_VALUE".
    
    From: https://docs.oracle.com/javase/8/docs/api/java/lang/Double.html
      MIN_VALUE A constant holding the smallest positive nonzero value of type double, 2-1074.


- Madhan Neethiraj


On July 26, 2019, 11:19 a.m., Mandar Ambawane wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/71160/
> -----------------------------------------------------------
> 
> (Updated July 26, 2019, 11:19 a.m.)
> 
> 
> Review request for atlas, Ashutosh Mestry, Madhan Neethiraj, Nixon Rodrigues, and Sarath Subramanian.
> 
> 
> Bugs: ATLAS-3347
>     https://issues.apache.org/jira/browse/ATLAS-3347
> 
> 
> Repository: atlas
> 
> 
> Description
> -------
> 
> This patch handles data type value exceeding and throws proper exception when we create Relationship entity.
> 
> 
> Diffs
> -----
> 
>   intg/src/main/java/org/apache/atlas/type/AtlasBuiltInTypes.java ce14b5b 
> 
> 
> Diff: https://reviews.apache.org/r/71160/diff/3/
> 
> 
> Testing
> -------
> 
> Testing done Lower limit and Upper limit of primitive datatypes.
> 
> Work in progress as some test cases are failing.
> 
> 
> Thanks,
> 
> Mandar Ambawane
> 
>


Re: Review Request 71160: ATLAS-3347 :- Relationships instance attributes validation for primitive inbuilt type.

Posted by Mandar Ambawane <ma...@freestoneinfotech.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/71160/
-----------------------------------------------------------

(Updated July 26, 2019, 11:19 a.m.)


Review request for atlas, Ashutosh Mestry, Madhan Neethiraj, Nixon Rodrigues, and Sarath Subramanian.


Changes
-------

ATLAS-3347 : Addressing review comments


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


Repository: atlas


Description
-------

This patch handles data type value exceeding and throws proper exception when we create Relationship entity.


Diffs (updated)
-----

  intg/src/main/java/org/apache/atlas/type/AtlasBuiltInTypes.java ce14b5b 


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

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


Testing
-------

Testing done Lower limit and Upper limit of primitive datatypes.

Work in progress as some test cases are failing.


Thanks,

Mandar Ambawane


Re: Review Request 71160: ATLAS-3347 :- Relationships instance attributes validation for primitive inbuilt type.

Posted by Madhan Neethiraj <ma...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/71160/#review216846
-----------------------------------------------------------




intg/src/main/java/org/apache/atlas/type/AtlasBuiltInTypes.java
Lines 70 (patched)
<https://reviews.apache.org/r/71160/#comment304099>

    null was a valid value earlier i.e AtlasBooleanType.isValidValue(null) returned 'true' earlier. After this update, this method will return 'false'. Is this intentional? Please review.


- Madhan Neethiraj


On July 25, 2019, 1:26 p.m., Mandar Ambawane wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/71160/
> -----------------------------------------------------------
> 
> (Updated July 25, 2019, 1:26 p.m.)
> 
> 
> Review request for atlas, Ashutosh Mestry, Madhan Neethiraj, Nixon Rodrigues, and Sarath Subramanian.
> 
> 
> Bugs: ATLAS-3347
>     https://issues.apache.org/jira/browse/ATLAS-3347
> 
> 
> Repository: atlas
> 
> 
> Description
> -------
> 
> This patch handles data type value exceeding and throws proper exception when we create Relationship entity.
> 
> 
> Diffs
> -----
> 
>   intg/src/main/java/org/apache/atlas/type/AtlasBuiltInTypes.java ce14b5b 
> 
> 
> Diff: https://reviews.apache.org/r/71160/diff/2/
> 
> 
> Testing
> -------
> 
> Testing done Lower limit and Upper limit of primitive datatypes.
> 
> Work in progress as some test cases are failing.
> 
> 
> Thanks,
> 
> Mandar Ambawane
> 
>


Re: Review Request 71160: ATLAS-3347 :- Relationships instance attributes validation for primitive inbuilt type.

Posted by Sarath Subramanian <sa...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/71160/#review216864
-----------------------------------------------------------




intg/src/main/java/org/apache/atlas/type/AtlasBuiltInTypes.java
Lines 64 (patched)
<https://reviews.apache.org/r/71160/#comment304114>

    can be replaced with - Boolean.valueOf((String) obj) != null


- Sarath Subramanian


On July 25, 2019, 6:26 a.m., Mandar Ambawane wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/71160/
> -----------------------------------------------------------
> 
> (Updated July 25, 2019, 6:26 a.m.)
> 
> 
> Review request for atlas, Ashutosh Mestry, Madhan Neethiraj, Nixon Rodrigues, and Sarath Subramanian.
> 
> 
> Bugs: ATLAS-3347
>     https://issues.apache.org/jira/browse/ATLAS-3347
> 
> 
> Repository: atlas
> 
> 
> Description
> -------
> 
> This patch handles data type value exceeding and throws proper exception when we create Relationship entity.
> 
> 
> Diffs
> -----
> 
>   intg/src/main/java/org/apache/atlas/type/AtlasBuiltInTypes.java ce14b5b 
> 
> 
> Diff: https://reviews.apache.org/r/71160/diff/2/
> 
> 
> Testing
> -------
> 
> Testing done Lower limit and Upper limit of primitive datatypes.
> 
> Work in progress as some test cases are failing.
> 
> 
> Thanks,
> 
> Mandar Ambawane
> 
>


Re: Review Request 71160: ATLAS-3347 :- Relationships instance attributes validation for primitive inbuilt type.

Posted by Madhan Neethiraj <ma...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/71160/#review216860
-----------------------------------------------------------




intg/src/main/java/org/apache/atlas/type/AtlasBuiltInTypes.java
Lines 61 (patched)
<https://reviews.apache.org/r/71160/#comment304109>

    isValidValue() should mirror the logic in getNormalizedValue() - which uses Boolean.valueOf() to convert obj to a Boolean. With this logic, there is no invalid value for Boolean type. Please review and update.



intg/src/main/java/org/apache/atlas/type/AtlasBuiltInTypes.java
Lines 107 (patched)
<https://reviews.apache.org/r/71160/#comment304110>

    Instead of validateNumberRange() that handles multiple types (byte/short/int/long/float/double/..), consider adding isValidRange(Number num) to corresponding Atlas*Type classes, and have getNormalizedValue() use this method:
     - AtlasByteType.isValidRange(Number num)
     - AtlasShortType.isValidRange(Number num)
     - AtlasIntType.isValidRange(Number num)
     - AtlasLongType.isValidRange(Number num)
     - AtlasFloatType.isValidRange(Number num)
     - AtlasDoubleType.isValidRange(Number num)
     - ..


- Madhan Neethiraj


On July 25, 2019, 1:26 p.m., Mandar Ambawane wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/71160/
> -----------------------------------------------------------
> 
> (Updated July 25, 2019, 1:26 p.m.)
> 
> 
> Review request for atlas, Ashutosh Mestry, Madhan Neethiraj, Nixon Rodrigues, and Sarath Subramanian.
> 
> 
> Bugs: ATLAS-3347
>     https://issues.apache.org/jira/browse/ATLAS-3347
> 
> 
> Repository: atlas
> 
> 
> Description
> -------
> 
> This patch handles data type value exceeding and throws proper exception when we create Relationship entity.
> 
> 
> Diffs
> -----
> 
>   intg/src/main/java/org/apache/atlas/type/AtlasBuiltInTypes.java ce14b5b 
> 
> 
> Diff: https://reviews.apache.org/r/71160/diff/2/
> 
> 
> Testing
> -------
> 
> Testing done Lower limit and Upper limit of primitive datatypes.
> 
> Work in progress as some test cases are failing.
> 
> 
> Thanks,
> 
> Mandar Ambawane
> 
>


Re: Review Request 71160: ATLAS-3347 :- Relationships instance attributes validation for primitive inbuilt type.

Posted by Mandar Ambawane <ma...@freestoneinfotech.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/71160/
-----------------------------------------------------------

(Updated July 25, 2019, 1:26 p.m.)


Review request for atlas, Ashutosh Mestry, Madhan Neethiraj, Nixon Rodrigues, and Sarath Subramanian.


Changes
-------

ATLAS-3347 :- Relationships instance attributes validation for primitive inbuilt type.


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


Repository: atlas


Description
-------

This patch handles data type value exceeding and throws proper exception when we create Relationship entity.


Diffs (updated)
-----

  intg/src/main/java/org/apache/atlas/type/AtlasBuiltInTypes.java ce14b5b 


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

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


Testing (updated)
-------

Testing done Lower limit and Upper limit of primitive datatypes.

Work in progress as some test cases are failing.


Thanks,

Mandar Ambawane