You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@atlas.apache.org by Ashutosh Mestry <am...@hortonworks.com> on 2017/06/19 19:41:03 UTC

Review Request 60204: Added Additional Validation to AtlasFloatType & AtlasDoubleType

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

Review request for atlas, Madhan Neethiraj and Sarath Subramanian.


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


Repository: atlas


Description
-------

**Background**
Refer to ATLAS-1876 for details. Please see the modified steps in comments section.

**Root Cause**
_AtlasBuiltInTypes_ do not validate the incoming types using the range check for the primitive types. This causes out of range _float_ and _double_ values to be passed as valid even when they are holding _Infinity_.

While the attribute value assignment goes through within the code, subsequent operations fail as the correct values are not present in the database.

**Fix**
Range check added for _float_ and _double_.


Diffs
-----

  intg/src/main/java/org/apache/atlas/type/AtlasBuiltInTypes.java f08a6015 
  intg/src/test/java/org/apache/atlas/type/AtlasBuiltInTypesTest.java PRE-CREATION 


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


Testing
-------

**Unit tests**
- New unit tests added for _AtlasFloatType_ and _AtlasDoubleType_.

**Functional tests**
- Validation verified by following steps mentioned in JIRA. Validation error is returned instead of successful operation.


Thanks,

Ashutosh Mestry


Re: Review Request 60204: Added Additional Validation to AtlasFloatType & AtlasDoubleType

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


Ship it!




Ship It!

- Madhan Neethiraj


On June 21, 2017, 3:10 a.m., Ashutosh Mestry wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/60204/
> -----------------------------------------------------------
> 
> (Updated June 21, 2017, 3:10 a.m.)
> 
> 
> Review request for atlas, Madhan Neethiraj and Sarath Subramanian.
> 
> 
> Bugs: ATLAS-1876
>     https://issues.apache.org/jira/browse/ATLAS-1876
> 
> 
> Repository: atlas
> 
> 
> Description
> -------
> 
> **Background**
> Refer to ATLAS-1876 for details. Please see the modified steps in comments section.
> 
> **Root Cause**
> _AtlasBuiltInTypes_ do not validate the incoming types using the range check for the primitive types. This causes out of range _float_ and _double_ values to be passed as valid even when they are holding _Infinity_.
> 
> While the attribute value assignment goes through within the code, subsequent operations fail as the correct values are not present in the database.
> 
> **Fix**
> Range check added for _float_ and _double_.
> 
> 
> Diffs
> -----
> 
>   intg/src/main/java/org/apache/atlas/type/AtlasBuiltInTypes.java f08a6015 
>   intg/src/main/java/org/apache/atlas/type/AtlasType.java f05cfd61 
>   intg/src/test/java/org/apache/atlas/type/TestAtlasBuiltInTypesFloatDouble.java PRE-CREATION 
>   repository/src/main/java/org/apache/atlas/repository/impexp/ZipSource.java aa1477f1 
>   repository/src/test/java/org/apache/atlas/repository/impexp/ZipSourceTest.java 8a57dcd8 
>   repository/src/test/resources/stocks-float.zip PRE-CREATION 
> 
> 
> Diff: https://reviews.apache.org/r/60204/diff/3/
> 
> 
> Testing
> -------
> 
> **Unit tests**
> - New unit tests added for _AtlasFloatType_ and _AtlasDoubleType_.
> - Verified all existing unit tests.
> 
> **Functional tests**
> - Validation verified by following steps mentioned in JIRA. Validation error is returned instead of successful operation.
> 
> 
> Thanks,
> 
> Ashutosh Mestry
> 
>


Re: Review Request 60204: Added Additional Validation to AtlasFloatType & AtlasDoubleType

Posted by Ashutosh Mestry <am...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/60204/
-----------------------------------------------------------

(Updated June 21, 2017, 3:10 a.m.)


Review request for atlas, Madhan Neethiraj and Sarath Subramanian.


Changes
-------

Updates include:
- ZipSource JSON serialization now uses _AtlasType.fromJSON_
- _ObjectMapper_ in _AtlasType_ now configured to handle large floats & doubles.


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


Repository: atlas


Description
-------

**Background**
Refer to ATLAS-1876 for details. Please see the modified steps in comments section.

**Root Cause**
_AtlasBuiltInTypes_ do not validate the incoming types using the range check for the primitive types. This causes out of range _float_ and _double_ values to be passed as valid even when they are holding _Infinity_.

While the attribute value assignment goes through within the code, subsequent operations fail as the correct values are not present in the database.

**Fix**
Range check added for _float_ and _double_.


Diffs (updated)
-----

  intg/src/main/java/org/apache/atlas/type/AtlasBuiltInTypes.java f08a6015 
  intg/src/main/java/org/apache/atlas/type/AtlasType.java f05cfd61 
  intg/src/test/java/org/apache/atlas/type/TestAtlasBuiltInTypesFloatDouble.java PRE-CREATION 
  repository/src/main/java/org/apache/atlas/repository/impexp/ZipSource.java aa1477f1 
  repository/src/test/java/org/apache/atlas/repository/impexp/ZipSourceTest.java 8a57dcd8 
  repository/src/test/resources/stocks-float.zip PRE-CREATION 


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

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


Testing
-------

**Unit tests**
- New unit tests added for _AtlasFloatType_ and _AtlasDoubleType_.
- Verified all existing unit tests.

**Functional tests**
- Validation verified by following steps mentioned in JIRA. Validation error is returned instead of successful operation.


Thanks,

Ashutosh Mestry


Re: Review Request 60204: Added Additional Validation to AtlasFloatType & AtlasDoubleType

Posted by Ashutosh Mestry <am...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/60204/
-----------------------------------------------------------

(Updated June 20, 2017, 3:07 p.m.)


Review request for atlas, Madhan Neethiraj and Sarath Subramanian.


Changes
-------

Updates to _Testing Done_ section.


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


Repository: atlas


Description
-------

**Background**
Refer to ATLAS-1876 for details. Please see the modified steps in comments section.

**Root Cause**
_AtlasBuiltInTypes_ do not validate the incoming types using the range check for the primitive types. This causes out of range _float_ and _double_ values to be passed as valid even when they are holding _Infinity_.

While the attribute value assignment goes through within the code, subsequent operations fail as the correct values are not present in the database.

**Fix**
Range check added for _float_ and _double_.


Diffs
-----

  intg/src/main/java/org/apache/atlas/type/AtlasBuiltInTypes.java f08a6015 
  intg/src/test/java/org/apache/atlas/type/TestAtlasBuiltInTypesFloatDouble.java PRE-CREATION 


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


Testing (updated)
-------

**Unit tests**
- New unit tests added for _AtlasFloatType_ and _AtlasDoubleType_.
- Verified all existing unit tests.

**Functional tests**
- Validation verified by following steps mentioned in JIRA. Validation error is returned instead of successful operation.


Thanks,

Ashutosh Mestry


Re: Review Request 60204: Added Additional Validation to AtlasFloatType & AtlasDoubleType

Posted by Ashutosh Mestry <am...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/60204/
-----------------------------------------------------------

(Updated June 20, 2017, 3:06 p.m.)


Review request for atlas, Madhan Neethiraj and Sarath Subramanian.


Changes
-------

Updates:
- Addressed review comments.
- Changed logic for validation.


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


Repository: atlas


Description
-------

**Background**
Refer to ATLAS-1876 for details. Please see the modified steps in comments section.

**Root Cause**
_AtlasBuiltInTypes_ do not validate the incoming types using the range check for the primitive types. This causes out of range _float_ and _double_ values to be passed as valid even when they are holding _Infinity_.

While the attribute value assignment goes through within the code, subsequent operations fail as the correct values are not present in the database.

**Fix**
Range check added for _float_ and _double_.


Diffs (updated)
-----

  intg/src/main/java/org/apache/atlas/type/AtlasBuiltInTypes.java f08a6015 
  intg/src/test/java/org/apache/atlas/type/TestAtlasBuiltInTypesFloatDouble.java PRE-CREATION 


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

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


Testing
-------

**Unit tests**
- New unit tests added for _AtlasFloatType_ and _AtlasDoubleType_.

**Functional tests**
- Validation verified by following steps mentioned in JIRA. Validation error is returned instead of successful operation.


Thanks,

Ashutosh Mestry


Re: Review Request 60204: Added Additional Validation to AtlasFloatType & AtlasDoubleType

Posted by Ashutosh Mestry <am...@hortonworks.com>.

> On June 20, 2017, 7:33 a.m., Sarath Subramanian wrote:
> >

Tests for built-in types exist. I just didn't find them. I will add my unit tests to those. Also I found flaw in my logic, I need to re-work it.

Please don't review, until I upload a new patch.


- Ashutosh


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


On June 19, 2017, 7:41 p.m., Ashutosh Mestry wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/60204/
> -----------------------------------------------------------
> 
> (Updated June 19, 2017, 7:41 p.m.)
> 
> 
> Review request for atlas, Madhan Neethiraj and Sarath Subramanian.
> 
> 
> Bugs: ATLAS-1876
>     https://issues.apache.org/jira/browse/ATLAS-1876
> 
> 
> Repository: atlas
> 
> 
> Description
> -------
> 
> **Background**
> Refer to ATLAS-1876 for details. Please see the modified steps in comments section.
> 
> **Root Cause**
> _AtlasBuiltInTypes_ do not validate the incoming types using the range check for the primitive types. This causes out of range _float_ and _double_ values to be passed as valid even when they are holding _Infinity_.
> 
> While the attribute value assignment goes through within the code, subsequent operations fail as the correct values are not present in the database.
> 
> **Fix**
> Range check added for _float_ and _double_.
> 
> 
> Diffs
> -----
> 
>   intg/src/main/java/org/apache/atlas/type/AtlasBuiltInTypes.java f08a6015 
>   intg/src/test/java/org/apache/atlas/type/AtlasBuiltInTypesTest.java PRE-CREATION 
> 
> 
> Diff: https://reviews.apache.org/r/60204/diff/1/
> 
> 
> Testing
> -------
> 
> **Unit tests**
> - New unit tests added for _AtlasFloatType_ and _AtlasDoubleType_.
> 
> **Functional tests**
> - Validation verified by following steps mentioned in JIRA. Validation error is returned instead of successful operation.
> 
> 
> Thanks,
> 
> Ashutosh Mestry
> 
>


Re: Review Request 60204: Added Additional Validation to AtlasFloatType & AtlasDoubleType

Posted by Ashutosh Mestry <am...@hortonworks.com>.

> On June 20, 2017, 7:33 a.m., Sarath Subramanian wrote:
> > intg/src/main/java/org/apache/atlas/type/AtlasBuiltInTypes.java
> > Lines 287 (patched)
> > <https://reviews.apache.org/r/60204/diff/1/?file=1753523#file1753523line287>
> >
> >     do we need similar validation in line 281 and 283, also 333 and 335?

My thinking is that by the time the control comes to this line, it has already undergone validation. Which means that it is valid Double/Float type.


> On June 20, 2017, 7:33 a.m., Sarath Subramanian wrote:
> > intg/src/test/java/org/apache/atlas/type/AtlasBuiltInTypesTest.java
> > Lines 44 (patched)
> > <https://reviews.apache.org/r/60204/diff/1/?file=1753524#file1753524line44>
> >
> >     consider adding test case for 'v' to be of type: Float/Number for line 44 and Double/Number for line 49.

TestAtlasBuiltFloatType already exists.


- Ashutosh


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


On June 19, 2017, 7:41 p.m., Ashutosh Mestry wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/60204/
> -----------------------------------------------------------
> 
> (Updated June 19, 2017, 7:41 p.m.)
> 
> 
> Review request for atlas, Madhan Neethiraj and Sarath Subramanian.
> 
> 
> Bugs: ATLAS-1876
>     https://issues.apache.org/jira/browse/ATLAS-1876
> 
> 
> Repository: atlas
> 
> 
> Description
> -------
> 
> **Background**
> Refer to ATLAS-1876 for details. Please see the modified steps in comments section.
> 
> **Root Cause**
> _AtlasBuiltInTypes_ do not validate the incoming types using the range check for the primitive types. This causes out of range _float_ and _double_ values to be passed as valid even when they are holding _Infinity_.
> 
> While the attribute value assignment goes through within the code, subsequent operations fail as the correct values are not present in the database.
> 
> **Fix**
> Range check added for _float_ and _double_.
> 
> 
> Diffs
> -----
> 
>   intg/src/main/java/org/apache/atlas/type/AtlasBuiltInTypes.java f08a6015 
>   intg/src/test/java/org/apache/atlas/type/AtlasBuiltInTypesTest.java PRE-CREATION 
> 
> 
> Diff: https://reviews.apache.org/r/60204/diff/1/
> 
> 
> Testing
> -------
> 
> **Unit tests**
> - New unit tests added for _AtlasFloatType_ and _AtlasDoubleType_.
> 
> **Functional tests**
> - Validation verified by following steps mentioned in JIRA. Validation error is returned instead of successful operation.
> 
> 
> Thanks,
> 
> Ashutosh Mestry
> 
>


Re: Review Request 60204: Added Additional Validation to AtlasFloatType & AtlasDoubleType

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




intg/src/main/java/org/apache/atlas/type/AtlasBuiltInTypes.java
Lines 287 (patched)
<https://reviews.apache.org/r/60204/#comment252259>

    do we need similar validation in line 281 and 283, also 333 and 335?



intg/src/main/java/org/apache/atlas/type/AtlasBuiltInTypes.java
Lines 294 (patched)
<https://reviews.apache.org/r/60204/#comment252258>

    this return is not needed



intg/src/test/java/org/apache/atlas/type/AtlasBuiltInTypesTest.java
Lines 44 (patched)
<https://reviews.apache.org/r/60204/#comment252260>

    consider adding test case for 'v' to be of type: Float/Number for line 44 and Double/Number for line 49.


- Sarath Subramanian


On June 19, 2017, 12:41 p.m., Ashutosh Mestry wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/60204/
> -----------------------------------------------------------
> 
> (Updated June 19, 2017, 12:41 p.m.)
> 
> 
> Review request for atlas, Madhan Neethiraj and Sarath Subramanian.
> 
> 
> Bugs: ATLAS-1876
>     https://issues.apache.org/jira/browse/ATLAS-1876
> 
> 
> Repository: atlas
> 
> 
> Description
> -------
> 
> **Background**
> Refer to ATLAS-1876 for details. Please see the modified steps in comments section.
> 
> **Root Cause**
> _AtlasBuiltInTypes_ do not validate the incoming types using the range check for the primitive types. This causes out of range _float_ and _double_ values to be passed as valid even when they are holding _Infinity_.
> 
> While the attribute value assignment goes through within the code, subsequent operations fail as the correct values are not present in the database.
> 
> **Fix**
> Range check added for _float_ and _double_.
> 
> 
> Diffs
> -----
> 
>   intg/src/main/java/org/apache/atlas/type/AtlasBuiltInTypes.java f08a6015 
>   intg/src/test/java/org/apache/atlas/type/AtlasBuiltInTypesTest.java PRE-CREATION 
> 
> 
> Diff: https://reviews.apache.org/r/60204/diff/1/
> 
> 
> Testing
> -------
> 
> **Unit tests**
> - New unit tests added for _AtlasFloatType_ and _AtlasDoubleType_.
> 
> **Functional tests**
> - Validation verified by following steps mentioned in JIRA. Validation error is returned instead of successful operation.
> 
> 
> Thanks,
> 
> Ashutosh Mestry
> 
>