> 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
> 
>

Reply via email to